Actions
Toggle group
stableA set of pressable toggles for switching views or formatting text.
since v2.41.4 kB gzip
Preview
View: grid · Marks: bold
Installation
npx @strata/cli add toggle-groupUsage
import { ToggleGroup, Toggle } from "@/components/strata";
<ToggleGroup defaultSelectedKeys={["grid"]}>
<Toggle id="grid">Grid</Toggle>
<Toggle id="list">List</Toggle>
</ToggleGroup>Props
| Prop | Type | Default |
|---|---|---|
selectionModeHow many items can be pressed at once. | "single" | "multiple" | "single" |
selectedKeysControlled pressed items. | Iterable<Key> | — |
variantGroup appearance. | "attached" | "segmented" | "spaced" | "attached" |
isDisabledPrevents interaction and dims the control. | boolean | false |
Accessibility
Related
Was this page helpful?
Documented since v2.4 · components/toggle-group.mdx