Back to library

Switch

Use a switch for a setting that takes effect as soon as it’s turned on or off, such as notifications.

Focus mode

Recommended API

Property or elementTypeExample initial valueDescription
aria-checkedARIA BooleantrueExpose whether Focus mode is enabled.
name / form valueForm attributesfocus-mode / onInclude the enabled setting in form data.

States

StateTriggerResult
on or offActivate the switch.The setting changes immediately and the form value follows.

CSS variables

VariableTypeDefaultDescription
--q-textcolor #28302aMain text and foreground color.
--q-mutedcolor #70776fColor for secondary text.
--q-font-sizelength 13pxBase size for the component text.
--q-accentcolor #344e41Accent for active controls, indicators and focus.
--q-on-accentcolor #ffffffForeground on the accent background.
--q-surfacecolor #ffffffSurface for controls and cards.
--q-bordercolor #dce0d8Color for outlines and dividers.
--q-border-widthlength 1pxThickness of the outline.
--q-gaplength calc(var(--q-space) * 2)Space between items, based on the spacing unit.
--q-durationtime 175msDuration of visual state transitions.
--q-spacelength 4pxBase unit for gaps and padding.