Toggle Group
Primitivesatlas-toggle-groupExamples
Single selection
Bind [(value)] to a signal; one item stays selected.
Selected: week
Multiple selection and sizes
With multiple , the value is an array. size takes sm , md or lg .
Selected: bold
Icon-only items and disabled items
An icon alone gives a button no name: set ariaLabel on icon-only items. disabled items stay visible but cannot be chosen.
Layout: grid (the board view needs a paid plan)
API
Generated from the library source, so it always matches the code.
AtlasToggleGroupComponent atlas-toggle-group
| Input | Type | Default | Description |
|---|---|---|---|
| items required | ToggleGroupItem[] | — | |
| value two-way | string | string[] | '' | |
| multiple | boolean | false | |
| size | ToggleGroupVariants['size'] | 'md' | |
| ariaLabel | string | undefined | undefined | |
| class | string | '' |
Types
ToggleGroupItem
| Property | Type | Description |
|---|---|---|
| value | string | |
| label? | string | |
| icon? | string | |
| ariaLabel? | string | label ). Without it the item is named by its value , since an icon alone gives the button no name. |
| disabled? | boolean |
ToggleGroupVariants
type ToggleGroupVariants = VariantProps<typeof toggleGroupVariants>