# Toggle Group ## Example ```svelte
1 2 3
``` ## Documentation ## Usage ```svelte 1 2 3 ``` ## Sources This component uses the bits-ui component: ToggleGroup, see here for the documentation for that: https://bits-ui.com/docs/components/toggle-group/llms.txt ## API Reference ### ToggleGroup A group of toggle buttons where one or multiple can be pressed. Built on top of the bits-ui ToggleGroup primitive. | Prop | Type | Default | Description | |------|------|---------|-------------| | type | `'single' | 'multiple'` | `-` | Whether a single or multiple items can be pressed at a time. (required) | | value | `string | string[]` | `-` | The currently pressed value(s). A string when type is "single", an array when "multiple". (bindable) | | onValueChange | `(value: string | string[]) => void` | `-` | A callback invoked when the pressed value changes. | | variant | `'default'` | `'default'` | The visual variant of the toggle group items. | | size | `'default' | 'sm' | 'lg'` | `'default'` | The size of the toggle group items. | | disabled | `boolean` | `false` | Whether the entire toggle group is disabled. | | loop | `boolean` | `true` | Whether keyboard navigation loops from last item to first and vice versa. | | orientation | `'horizontal' | 'vertical'` | `'horizontal'` | The orientation of the toggle group for keyboard navigation. | | rovingFocus | `boolean` | `true` | Whether the toggle group uses roving focus management. | | class | `string` | `-` | Additional CSS classes to apply. | | ref | `HTMLElement` | `-` | The underlying DOM element. (bindable) | ### ToggleGroupItem A single item within a toggle group. | Prop | Type | Default | Description | |------|------|---------|-------------| | value | `string` | `-` | The value of this toggle item. (required, bindable) | | variant | `'default'` | `-` | Override the visual variant for this specific item. Falls back to the parent ToggleGroup variant. | | size | `'default' | 'sm' | 'lg'` | `-` | Override the size for this specific item. Falls back to the parent ToggleGroup size. | | disabled | `boolean` | `false` | Whether this item is disabled. | | class | `string` | `-` | Additional CSS classes to apply. | | ref | `HTMLElement` | `-` | The underlying DOM element. (bindable) |