Toggle buttons
Apply or remove one or more options, such as text formatting.
Recommended API
| Property or element | Type | Example initial value | Description |
|---|---|---|---|
aria-pressed | ARIA Boolean | Bold initially selected | Expose each independent formatting choice. |
tabindex | Integer | 0 for the focused item | Keep one tab stop and navigate within the group using arrow keys. |
States
| State | Trigger | Result |
|---|---|---|
selection changed | Toggle 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
| Variable | Type | Default | Description |
|---|---|---|---|
--q-text | color | #28302a | Main text and foreground color. |
--q-muted | color | #70776f | Color for secondary text. |
--q-font-size | length | 13px | Base size for the component text. |
--q-accent | color | #344e41 | Accent for active controls, indicators and focus. |
--q-surface | color | #ffffff | Surface for controls and cards. |
--q-border | color | #dce0d8 | Color for outlines and dividers. |
--q-radius | length | 10px | Base corner radius. |