Back to library

Toggle buttons

Apply or remove one or more options, such as text formatting.

Recommended API

Property or elementTypeExample initial valueDescription
aria-pressedARIA BooleanBold initially selectedExpose each independent formatting choice.
tabindexInteger0 for the focused itemKeep one tab stop and navigate within the group using arrow keys.

States

StateTriggerResult
selection changedToggle a formatting button.Only that button changes its pressed state.

Svelte implementation guidance

Related toggle buttons support multiple selections and roving keyboard focus.

Use the copied Svelte example as a starting point.

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-surfacecolor #ffffffSurface for controls and cards.
--q-bordercolor #dce0d8Color for outlines and dividers.
--q-radiuslength 10pxBase corner radius.