Toggle group
A set of two-state buttons that share one value, with one tab stop for the whole set.
import { ToggleGroup, ToggleGroupItem } from '@slotted/react/toggle-group';export default function ToggleGroupBasic() { return ( <ToggleGroup aria-label="Revenue period" defaultValue={['week']}> <ToggleGroupItem value="day">Day</ToggleGroupItem> <ToggleGroupItem value="week">Week</ToggleGroupItem> <ToggleGroupItem value="month">Month</ToggleGroupItem> <ToggleGroupItem value="quarter">Quarter</ToggleGroupItem> </ToggleGroup> );}Installation
The packages are a 0.x beta on npm, and their public API changes between beta releases without deprecation. One line installs the binding and the default theme.
pnpm add @slotted/react @slotted/theme @slotted/themesimport { ToggleGroup, ToggleGroupDefaultsProvider, ToggleGroupItem } from '@slotted/react';Value
Each item carries a value, and the group holds the values that are on. The value is an array in every mode, so a group that allows one item at a time holds an array of one. defaultValue sets the starting value of an uncontrolled group and is read once. multiple allows several items on at once. By default, pressing the active item turns it off and the group empties; deselectable={false} in React and [deselectable]="false" in Angular keeps the last item on, and the property has no effect while multiple is set.
import { Stack } from '@slotted/react/stack';import { ToggleGroup, ToggleGroupItem } from '@slotted/react/toggle-group';import { Text } from '@slotted/react/typography';export default function ToggleGroupSelection() { return ( <Stack gap={5}> <Stack gap={2}> <Text size="sm" tone="muted"> One at a time, and none when the active item is pressed again </Text> <ToggleGroup aria-label="Shipping speed" defaultValue={['standard']}> <ToggleGroupItem value="standard">Standard</ToggleGroupItem> <ToggleGroupItem value="express">Express</ToggleGroupItem> <ToggleGroupItem value="overnight">Overnight</ToggleGroupItem> </ToggleGroup> </Stack> <Stack gap={2}> <Text size="sm" tone="muted"> Several at once </Text> <ToggleGroup aria-label="Order channels" defaultValue={['web', 'retail']} multiple> <ToggleGroupItem value="web">Web</ToggleGroupItem> <ToggleGroupItem value="retail">Retail</ToggleGroupItem> <ToggleGroupItem value="wholesale">Wholesale</ToggleGroupItem> </ToggleGroup> </Stack> <Stack gap={2}> <Text size="sm" tone="muted"> One at a time, always one </Text> <ToggleGroup aria-label="Reporting currency" defaultValue={['usd']} deselectable={false}> <ToggleGroupItem value="usd">USD</ToggleGroupItem> <ToggleGroupItem value="eur">EUR</ToggleGroupItem> <ToggleGroupItem value="gbp">GBP</ToggleGroupItem> </ToggleGroup> </Stack> </Stack> );}Variants
variant sets how the items are drawn. outline, the default, draws the bar’s own edge. ghost draws none, for a bar inside a surface that already has one, such as a toolbar or a card header. The color of an item that is on is the same in both. chips draws separate rounded items that wrap onto the next line and are never joined, with the pressed item in the neutral tone. Use chips for filters that grow with the data.
import { Stack } from '@slotted/react/stack';import { ToggleGroup, ToggleGroupItem } from '@slotted/react/toggle-group';import { Text } from '@slotted/react/typography';export default function ToggleGroupVariants() { return ( <Stack gap={5}> <Stack gap={2}> <Text size="sm" tone="muted"> outline </Text> <ToggleGroup aria-label="Table density" defaultValue={['compact']} variant="outline"> <ToggleGroupItem value="comfortable">Comfortable</ToggleGroupItem> <ToggleGroupItem value="compact">Compact</ToggleGroupItem> </ToggleGroup> </Stack> <Stack gap={2}> <Text size="sm" tone="muted"> ghost </Text> <ToggleGroup aria-label="Row height" defaultValue={['compact']} variant="ghost"> <ToggleGroupItem value="comfortable">Comfortable</ToggleGroupItem> <ToggleGroupItem value="compact">Compact</ToggleGroupItem> </ToggleGroup> </Stack> <Stack gap={2}> <Text size="sm" tone="muted"> chips </Text> <ToggleGroup aria-label="Product categories" defaultValue={['packaging', 'pallets']} multiple variant="chips" > <ToggleGroupItem value="hardware">Hardware</ToggleGroupItem> <ToggleGroupItem value="packaging">Packaging</ToggleGroupItem> <ToggleGroupItem value="pallets">Pallets</ToggleGroupItem> <ToggleGroupItem value="labels">Labels</ToggleGroupItem> <ToggleGroupItem value="safety">Safety gear</ToggleGroupItem> <ToggleGroupItem value="cleaning">Cleaning</ToggleGroupItem> </ToggleGroup> </Stack> </Stack> );}Sizes
size takes sm, md or lg and sets the bar and every item to one control step. A bar is as tall as a text field or a button of the same size, so the three line up in one row.
import { Stack } from '@slotted/react/stack';import { ToggleGroup, ToggleGroupItem } from '@slotted/react/toggle-group';import { Text } from '@slotted/react/typography';export default function ToggleGroupSizes() { return ( <Stack gap={5}> <Stack gap={2}> <Text size="sm" tone="muted"> sm </Text> <ToggleGroup aria-label="Order sorting, small" defaultValue={['newest']} size="sm"> <ToggleGroupItem value="newest">Newest</ToggleGroupItem> <ToggleGroupItem value="oldest">Oldest</ToggleGroupItem> <ToggleGroupItem value="largest">Largest</ToggleGroupItem> </ToggleGroup> </Stack> <Stack gap={2}> <Text size="sm" tone="muted"> md </Text> <ToggleGroup aria-label="Order sorting, medium" defaultValue={['newest']} size="md"> <ToggleGroupItem value="newest">Newest</ToggleGroupItem> <ToggleGroupItem value="oldest">Oldest</ToggleGroupItem> <ToggleGroupItem value="largest">Largest</ToggleGroupItem> </ToggleGroup> </Stack> <Stack gap={2}> <Text size="sm" tone="muted"> lg </Text> <ToggleGroup aria-label="Order sorting, large" defaultValue={['newest']} size="lg"> <ToggleGroupItem value="newest">Newest</ToggleGroupItem> <ToggleGroupItem value="oldest">Oldest</ToggleGroupItem> <ToggleGroupItem value="largest">Largest</ToggleGroupItem> </ToggleGroup> </Stack> </Stack> );}Layout
fullWidth makes the items share the whole line; without it the bar is as wide as its labels. attached is true by default and joins the items into one bar, and false spaces them apart. orientation="vertical" stacks the items and writes aria-orientation on the group. The chips variant is never attached.
import { Stack } from '@slotted/react/stack';import { ToggleGroup, ToggleGroupItem } from '@slotted/react/toggle-group';import { Text } from '@slotted/react/typography';export default function ToggleGroupLayout() { return ( <Stack gap={5}> <Stack gap={2}> <Text size="sm" tone="muted"> fullWidth </Text> <ToggleGroup aria-label="Billing cycle" defaultValue={['monthly']} fullWidth> <ToggleGroupItem value="monthly">Monthly</ToggleGroupItem> <ToggleGroupItem value="yearly">Yearly</ToggleGroupItem> </ToggleGroup> </Stack> <Stack gap={2}> <Text size="sm" tone="muted"> attached off </Text> <ToggleGroup aria-label="Order status filter" attached={false} defaultValue={['open']} multiple > <ToggleGroupItem value="open">Open</ToggleGroupItem> <ToggleGroupItem value="packed">Packed</ToggleGroupItem> <ToggleGroupItem value="shipped">Shipped</ToggleGroupItem> </ToggleGroup> </Stack> <Stack gap={2}> <Text size="sm" tone="muted"> vertical </Text> <ToggleGroup aria-label="Warehouse zone" defaultValue={['storage']} orientation="vertical"> <ToggleGroupItem value="receiving">Receiving</ToggleGroupItem> <ToggleGroupItem value="storage">Storage</ToggleGroupItem> <ToggleGroupItem value="dispatch">Dispatch</ToggleGroupItem> </ToggleGroup> </Stack> </Stack> );}States
An item is pressed when its value is in the group’s value. disabled on an item sets the native disabled attribute, which removes it from the tab order and from the arrow keys while the rest of the bar stays live. An item that is on and disabled keeps both states, so the bar still shows the value. disabled on the group reaches every item that does not state its own.
import { Stack } from '@slotted/react/stack';import { ToggleGroup, ToggleGroupItem } from '@slotted/react/toggle-group';import { Text } from '@slotted/react/typography';export default function ToggleGroupStates() { return ( <Stack gap={5}> <Stack gap={2}> <Text size="sm" tone="muted"> One item unavailable </Text> <ToggleGroup aria-label="Export format" defaultValue={['csv']}> <ToggleGroupItem value="csv">CSV</ToggleGroupItem> <ToggleGroupItem disabled value="xlsx"> XLSX </ToggleGroupItem> <ToggleGroupItem value="pdf">PDF</ToggleGroupItem> </ToggleGroup> </Stack> <Stack gap={2}> <Text size="sm" tone="muted"> Unavailable while on </Text> <ToggleGroup aria-label="Invoice status" defaultValue={['approved']}> <ToggleGroupItem value="draft">Draft</ToggleGroupItem> <ToggleGroupItem disabled value="approved"> Approved </ToggleGroupItem> <ToggleGroupItem value="paid">Paid</ToggleGroupItem> </ToggleGroup> </Stack> <Stack gap={2}> <Text size="sm" tone="muted"> Whole group unavailable </Text> <ToggleGroup aria-label="Payment terms" defaultValue={['net30']} disabled> <ToggleGroupItem value="net15">Net 15</ToggleGroupItem> <ToggleGroupItem value="net30">Net 30</ToggleGroupItem> <ToggleGroupItem value="net60">Net 60</ToggleGroupItem> </ToggleGroup> </Stack> </Stack> );}Marks and words
An item takes a mark before its words. In React the mark is the icon prop of ToggleGroupItem; in Angular it is an element with slToggleGroupIcon inside the button. The mark is sized from the control glyph scale and hidden from assistive technology, so the words beside it name the item.
import { Glyph } from '@slotted/react/icon';import { ToggleGroup, ToggleGroupItem } from '@slotted/react/toggle-group';export default function ToggleGroupIcons() { return ( <ToggleGroup aria-label="Listing visibility" defaultValue={['shown']}> <ToggleGroupItem icon={<Glyph name="eye" />} value="shown"> Shown </ToggleGroupItem> <ToggleGroupItem icon={<Glyph name="eye-off" />} value="hidden"> Hidden </ToggleGroupItem> </ToggleGroup> );}Marks without words
An item without words holds one mark and takes its accessible name from an aria-label on the item. Without the label the item has no name.
import { Glyph } from '@slotted/react/icon';import { ToggleGroup, ToggleGroupItem } from '@slotted/react/toggle-group';export default function ToggleGroupIconOnly() { return ( <ToggleGroup aria-label="Order flags" defaultValue={['starred']} multiple> <ToggleGroupItem aria-label="Starred" icon={<Glyph name="star" />} value="starred" /> <ToggleGroupItem aria-label="Pinned" icon={<Glyph name="pin" />} value="pinned" /> <ToggleGroupItem aria-label="Watching" icon={<Glyph name="bell" />} value="watching" /> </ToggleGroup> );}Controlled
Pass value to own the selection. A press calls onValueChange(value, request) in React and emits valueChange in Angular, and the group moves only when the application passes the new array back. The request carries value, previous, reason (pointer or keyboard) and cancel(). In Angular the emitted object is the request, so the new array is $event.value. Here the handler refuses a fourth column with cancel().
import { useState } from 'react';import { Stack } from '@slotted/react/stack';import { ToggleGroup, ToggleGroupItem } from '@slotted/react/toggle-group';import { Text } from '@slotted/react/typography';const LIMIT = 3;export default function ToggleGroupControlled() { const [columns, setColumns] = useState<readonly string[]>(['sku', 'quantity']); return ( <Stack gap={3}> <ToggleGroup aria-label="Visible columns" multiple onValueChange={(value, request) => { if (value.length > LIMIT) request.cancel(); else setColumns(value); }} value={columns} > <ToggleGroupItem value="sku">SKU</ToggleGroupItem> <ToggleGroupItem value="quantity">Quantity</ToggleGroupItem> <ToggleGroupItem value="location">Location</ToggleGroupItem> <ToggleGroupItem value="supplier">Supplier</ToggleGroupItem> </ToggleGroup> <Text size="sm" tone="muted"> {columns.length} of {LIMIT} columns: {columns.join(', ') || 'none'} </Text> </Stack> );}Inside a toolbar
A toolbar is one tab stop with arrow navigation across every control it holds. A toggle group inside a toolbar does not hold a second tab stop, and the toolbar moves focus between the buttons of the group. The group finds the toolbar in the DOM, so nothing is passed. rovingFocus states the choice for a bar that is not a Slotted toolbar.
import { Button } from '@slotted/react/button';import { ToggleGroup, ToggleGroupItem } from '@slotted/react/toggle-group';import { Toolbar, ToolbarSeparator } from '@slotted/react/toolbar';export default function ToggleGroupToolbar() { return ( <Toolbar aria-label="Sales report"> <ToggleGroup aria-label="Chart type" defaultValue={['bars']} variant="ghost"> <ToggleGroupItem value="bars">Bars</ToggleGroupItem> <ToggleGroupItem value="lines">Lines</ToggleGroupItem> </ToggleGroup> <ToolbarSeparator /> <ToggleGroup aria-label="Overlays" defaultValue={['forecast']} multiple variant="ghost"> <ToggleGroupItem value="forecast">Forecast</ToggleGroupItem> <ToggleGroupItem value="prior-year">Prior year</ToggleGroupItem> </ToggleGroup> <ToolbarSeparator /> <Button size="sm" tone="secondary" variant="ghost"> Export </Button> </Toolbar> );}Inside a field
A toggle group inside a field is named by the field label through aria-labelledby. An aria-label or aria-labelledby written on the group wins over the field label. A group is not a form control: it submits no value.
The carrier confirms the slot the day before.
import { Field, FieldDescription, FieldLabel } from '@slotted/react/field';import { ToggleGroup, ToggleGroupItem } from '@slotted/react/toggle-group';export default function ToggleGroupField() { return ( <Field> <FieldLabel>Delivery window</FieldLabel> <ToggleGroup defaultValue={['afternoon']}> <ToggleGroupItem value="morning">Morning</ToggleGroupItem> <ToggleGroupItem value="afternoon">Afternoon</ToggleGroupItem> <ToggleGroupItem value="evening">Evening</ToggleGroupItem> </ToggleGroup> <FieldDescription>The carrier confirms the slot the day before.</FieldDescription> </Field> );}Keyboard
Tab enters the group once, on the pressed item or on the first item that is not disabled. The arrow keys, Home and End move focus and never change the value. Space and Enter toggle the focused item. A horizontal group answers ArrowLeft and ArrowRight, and a vertical group answers ArrowUp and ArrowDown; the other pair is left to the page so scrolling continues. loop is true by default and wraps focus past the ends; loop={false} in React and [loop]="false" in Angular stops it at the first and last items.
import { Stack } from '@slotted/react/stack';import { ToggleGroup, ToggleGroupItem } from '@slotted/react/toggle-group';import { Text } from '@slotted/react/typography';export default function ToggleGroupKeyboard() { return ( <Stack gap={5}> <Stack gap={2}> <Text size="sm" tone="muted"> Arrows wrap at the ends </Text> <ToggleGroup aria-label="Pick window" defaultValue={['morning']}> <ToggleGroupItem value="morning">Morning</ToggleGroupItem> <ToggleGroupItem value="afternoon">Afternoon</ToggleGroupItem> <ToggleGroupItem value="night">Night</ToggleGroupItem> </ToggleGroup> </Stack> <Stack gap={2}> <Text size="sm" tone="muted"> Arrows stop at the ends </Text> <ToggleGroup aria-label="Dock shift" defaultValue={['early']} loop={false}> <ToggleGroupItem value="early">Early</ToggleGroupItem> <ToggleGroupItem value="late">Late</ToggleGroupItem> <ToggleGroupItem value="overnight">Overnight</ToggleGroupItem> </ToggleGroup> </Stack> </Stack> );}Defaults
ToggleGroupDefaultsProvider in React and provideToggleGroupDefaults in Angular set size, variant, orientation, attached, deselectable and loop once for every group under them. A group that states a value of its own keeps it. In the example the second group states variant="outline" and takes the rest from the provider.
import { Stack } from '@slotted/react/stack';import { ToggleGroup, ToggleGroupDefaultsProvider, ToggleGroupItem,} from '@slotted/react/toggle-group';import { Text } from '@slotted/react/typography';export default function ToggleGroupDefaults() { return ( <ToggleGroupDefaultsProvider size="sm" variant="ghost" deselectable={false}> <Stack gap={5}> <Stack gap={2}> <Text size="sm" tone="muted"> Inherits the provider </Text> <ToggleGroup aria-label="Table density" defaultValue={['compact']}> <ToggleGroupItem value="comfortable">Comfortable</ToggleGroupItem> <ToggleGroupItem value="compact">Compact</ToggleGroupItem> </ToggleGroup> </Stack> <Stack gap={2}> <Text size="sm" tone="muted"> States its own variant </Text> <ToggleGroup aria-label="Row height" defaultValue={['compact']} variant="outline"> <ToggleGroupItem value="comfortable">Comfortable</ToggleGroupItem> <ToggleGroupItem value="compact">Compact</ToggleGroupItem> </ToggleGroup> </Stack> </Stack> </ToggleGroupDefaultsProvider> );}Accessibility
| Key | Effect | Focus |
|---|---|---|
| Tab | moves focus into the group, which holds one tab stop however many items it has | the pressed item, or the first item that is not disabled |
| Space | toggles the focused item | stays on the item |
| Enter | toggles the focused item | stays on the item |
| ArrowRight | moves to the next item in a horizontal group and wraps at the end; it never toggles, because an item is a button | the item moved to |
| ArrowLeft | moves to the previous item in a horizontal group and wraps at the start; it never toggles, because an item is a button | the item moved to |
| ArrowDown | the same as ArrowRight in a vertical group, and nothing in a horizontal one so the page keeps scrolling | the item moved to, in a vertical group |
| ArrowUp | the same as ArrowLeft in a vertical group, and nothing in a horizontal one so the page keeps scrolling | the item moved to, in a vertical group |
| Home | moves to the first item that is not disabled | the first enabled item |
| End | moves to the last item that is not disabled | the last enabled item |
- There is no APG pattern called “toggle group”. The container is a group, each item is the Button pattern’s toggle button (w3.org/WAI/ARIA/apg/patterns/button/), and the movement between them is the Toolbar pattern’s roving tabindex (w3.org/WAI/ARIA/apg/patterns/toolbar/). Citing one and implying the other is how a family ends up with half a keyboard.
- So the arrows move focus and never toggle, which is the one place toggle group and segmented-control genuinely differ and the one a reader feels. Space and Enter turn the focused item on or off; Home and End reach the ends; a horizontal group ignores the cross axis so the page keeps scrolling with focus inside it.
- aria-pressed is written in both states, so an item is announced as a toggle rather than as a button that happens to be pressed — and the label never changes with the state, which the Button pattern calls critical. An item with only a mark takes its name from an aria-label the consumer writes.
- Inside a toolbar the group gives its keyboard up: a bar is already one tab stop with arrow navigation across every control it holds. The bar is found in the DOM by its public identifier rather than through an imported context, so neither depends on the other; rovingFocus states it outright for a bar this library did not write.
- disabled is the native attribute, because that is also what makes the browser refuse focus and what makes the ring skip the item. The group is not a form control: a set of choices a form submits is checkbox-group for many and segmented-control for one.
- The target is the item itself, never narrower than it is tall, so the WCAG 2.2 minimum of 24 by 24 holds at the smallest step and the tightest density — and the theme grows every control to 44 under a coarse pointer.
API
ToggleGroup
Props
valuereadonly string[]- Present means the consumer owns the set, for the life of the component. Absent, the group owns it and starts from defaultValue
defaultValuereadonly string[]- What an uncontrolled group starts from, read once. A later change to it does not silently become new state
multiplebooleanDefaultfalse- Whether more than one item may be on at a time. The value stays an array either way, so both bindings hold one shape and a single-select consumer writes an array of one
deselectablebooleanDefaulttrue- Whether the last item on may be turned off. Ignored while multiple is true, where a set may always empty
size'sm' | 'md' | 'lg'Defaultmd- The control step the bar and every item sit at. It reads the control scale, so the bar is as tall as the field beside it
variant'outline' | 'ghost' | 'chips'Defaultoutline- Whether the bar draws its own edge, or draws its items as chips: separate rounded items that wrap, never joined, the pressed one in the neutral tone ink. There is no tone axis: “on” is one color across the system, and a bar that wants the whole palette is button-group around ToggleButtons
orientation'horizontal' | 'vertical'Defaulthorizontal- How the items flow, and which pair of arrows moves focus. A vertical group writes aria-orientation
attachedbooleanDefaulttrue- Whether the items are joined into one bar or spaced apart. A joined bar overlaps its items by one border so a shared column holds one line
fullWidthbooleanDefaultfalse- Whether the items share the whole line. Left alone the bar is as wide as its labels
loopbooleanDefaulttrue- Whether the arrows wrap past the ends of the set
rovingFocusbooleanDefaultinferred- Whether the group holds a tab stop of its own. Unstated it is inferred: a group inside a toolbar stands down, because a bar is already one stop with arrow navigation across every control it holds
disabledbooleanDefaultfalse- Unstated rather than false, so an item may state its own. Stated, it reaches every item as the native attribute, which is also what makes the browser skip it with the arrows
value, on ToggleGroupItemstring- On ToggleGroupItemWhat this item turns on, and what the group’s value holds. It is required: an item with no value is a control that changes nothing
icon, on ToggleGroupItemReactNode- On ToggleGroupItemThe mark drawn before the words, sized from the control glyph scale and hidden from the reading order
disabled, on ToggleGroupItemboolean- On ToggleGroupItemOne item out of action while the rest of the bar stays live. An item that is on and unavailable keeps saying both
Events
| Name | Payload | When |
|---|---|---|
onValueChange | (value: readonly string[], request: ChangeRequest<readonly string[]>) | Before the value moves. The request carries the new array, the array it replaces, the reason — pointer or keyboard — the originating event, and cancel(), which refuses the move before anything commits. Nothing is emitted for a value equal to the one the group already holds. |
onClick, onFocus, onBlur, on each item | the element’s own events | Whenever that item’s button fires them. ToggleGroupItem composes with the application’s handler rather than replacing it: the application’s runs first, and always runs. Calling preventDefault() in onClick stops the toggle as well. |
Composition
render(props: ToggleGroupRootProps | ToggleGroupItemRootProps) => ReactNode- On ToggleGroup, ToggleGroupItemSubstitutes either root and hands it every attribute the family was going to write, including the ref the group needs for its own ring
refRef<HTMLDivElement> | Ref<HTMLButtonElement>- On ToggleGroup, ToggleGroupItemReaches the element. focus() and click() are the element’s own, so no imperative handle is invented for what the platform already ships
useToggleGroup()() => ToggleGroupContextValue- On inside a ToggleGroupWhat an item reads to know whether it is on and how to ask for a change. It throws outside a group rather than rendering a button that toggles nothing
ToggleGroupDefaultsProvider{ attached, deselectable, loop, orientation, size, variant }- On a subtreeThe six decisions an application takes once. A group that states any of them itself still wins
rolestringDefaultgroup- A consumer’s own wins. The family writes group and never toolbar: toolbar is a keyboard model, and it is the toolbar family
Parts
| Part | Element | Required | Purpose |
|---|---|---|---|
root | div, or the element render returns | Yes | The group. It carries role="group", data-ui="toggle-group", the axes, and one tab stop for the whole set. It states no frame of its own: a joined bar has one edge, and the items make it between them, which is also what keeps the bar exactly one control tall. |
item | button, or the element ToggleGroupItem’s render returns | Yes | One two-state control. It carries aria-pressed in both states and data-pressed when it is on, and its border is always present so that turning it on changes a color and never the geometry. |
icon | span | No | The mark an item was given, sized from the control glyph scale and hidden from the reading order. An item with a mark and no words takes its accessible name from the aria-label the consumer writes. |
label | span | No | The words. A box of their own, so a label the bar made too narrow clips at the ellipsis instead of wrapping the item onto a second line — and the string stays whole in the DOM. |
Theming
Each token is a CSS custom property: set it in a theme, or on any element to retune every toggle group inside it.
Toggle group tokens
| Token | Default |
|---|---|
--slotted-toggle-group-active-background | var(--slotted-tone-secondary-subtle-active, ButtonFace) |
--slotted-toggle-group-border-color | var(--slotted-control-border-color, ButtonBorder) |
--slotted-toggle-group-chips-gap | var(--slotted-space-3, 0.375rem) |
--slotted-toggle-group-chips-pressed-background | var(--slotted-tone-neutral-solid, CanvasText) |
--slotted-toggle-group-chips-pressed-color | var(--slotted-tone-neutral-on-solid, Canvas) |
--slotted-toggle-group-chips-radius | var(--slotted-radius-full, 9999px) |
--slotted-toggle-group-color | var(--slotted-text, ButtonText) |
--slotted-toggle-group-disabled-border-color | var(--slotted-disabled-border, GrayText) |
--slotted-toggle-group-disabled-color | var(--slotted-disabled-foreground, GrayText) |
--slotted-toggle-group-disabled-pressed-background | var(--slotted-disabled-background, ButtonFace) |
--slotted-toggle-group-hover-background | var(--slotted-tone-secondary-subtle-hover, ButtonFace) |
--slotted-toggle-group-pressed-background | var(--slotted-tone-accent-subtle-active, Highlight) |
--slotted-toggle-group-pressed-border-color | var(--slotted-tone-accent-border, Highlight) |
--slotted-toggle-group-pressed-color | var(--slotted-tone-accent-text, HighlightText) |
--slotted-toggle-group-pressed-hover-background | var(--slotted-tone-accent-subtle-hover, Highlight) |
--slotted-toggle-group-radius | var(--slotted-control-radius, 4px) |
--slotted-toggle-group-shadow | var(--slotted-control-shadow, none) |
Theme tokens it reads
| Token | Default |
|---|---|
--slotted-control-border-color | Set per scheme by the theme |
--slotted-control-border-width | var(--slotted-border-width-thin) |
--slotted-control-font-family | var(--slotted-font-family-sans) |
--slotted-control-font-size-lg | comfortable 14px · compact 13px · dense 12px |
--slotted-control-font-size-md | comfortable 13px · compact 12px · dense 12px |
--slotted-control-font-size-sm | comfortable 12px · compact 12px · dense 12px |
--slotted-control-font-weight | var(--slotted-font-weight-semibold) |
--slotted-control-gap-lg | comfortable 8px · compact 6px · dense 6px |
--slotted-control-gap-md | comfortable 8px · compact 6px · dense 4px |
--slotted-control-gap-sm | comfortable 6px · compact 4px · dense 4px |
--slotted-control-height-lg | comfortable 38px · compact 32px · dense 30px |
--slotted-control-height-md | comfortable 34px · compact 28px · dense 26px |
--slotted-control-height-sm | comfortable 30px · compact 26px · dense 24px |
--slotted-control-icon-size-lg | comfortable 18px · compact 16px · dense 14px |
--slotted-control-icon-size-md | comfortable 16px · compact 14px · dense 13px |
--slotted-control-icon-size-sm | comfortable 14px · compact 13px · dense 12px |
--slotted-control-letter-spacing | 0 |
--slotted-control-line-height | 1 |
--slotted-control-padding-inline-lg | comfortable 16px · compact 12px · dense 10px |
--slotted-control-padding-inline-md | comfortable 13px · compact 10px · dense 8px |
--slotted-control-padding-inline-sm | comfortable 10px · compact 8px · dense 6px |
--slotted-control-radius | var(--slotted-radius-sm) |
--slotted-control-shadow | Set per scheme by the theme |
--slotted-control-transition-duration | var(--slotted-duration-short) |
--slotted-control-transition-easing | var(--slotted-easing-standard) |
--slotted-disabled-background | Set per scheme by the theme |
--slotted-disabled-border | Set per scheme by the theme |
--slotted-disabled-foreground | Set per scheme by the theme |
--slotted-duration-instant | 1ms |
--slotted-focus-ring-color | Set per scheme by the theme |
--slotted-focus-ring-offset | var(--slotted-border-width-thick) |
--slotted-focus-ring-width | var(--slotted-border-width-thick) |
--slotted-font-weight-medium | 500 |
--slotted-radius-full | 9999px |
--slotted-space-3 | 0.375rem |
--slotted-text | Set per scheme by the theme |
--slotted-tone-accent-border | Set per scheme by the theme |
--slotted-tone-accent-subtle-active | Set per scheme by the theme |
--slotted-tone-accent-subtle-hover | Set per scheme by the theme |
--slotted-tone-accent-text | Set per scheme by the theme |
--slotted-tone-neutral-on-solid | Set per scheme by the theme |
--slotted-tone-neutral-solid | Set per scheme by the theme |
--slotted-tone-neutral-solid-hover | Set per scheme by the theme |
--slotted-tone-secondary-subtle-active | Set per scheme by the theme |
--slotted-tone-secondary-subtle-hover | Set per scheme by the theme |