Put a ToggleGroupItem per choice.
range-picker.tsx
ToggleGroup
<div>| Prop | Type | Default | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| size | "default""lg""sm""xs" | "default" | Height 24, 28, 32, or 36px. | ||||||||||||||||||||||||||||||
| rounded | "default""full" | "default" | |||||||||||||||||||||||||||||||
| class | string | — | |||||||||||||||||||||||||||||||
| variant | "default""outline" | "outline" | The look of the items: outline (default) for a row of toggles, default for quiet rows with no border (a list of places or views in a panel, pressed on the accent fill). | ||||||||||||||||||||||||||||||
| spacing | 0.51234 | 2 | The gap between the items: 0.5 to 4 is 2 to 16px. Default 2 (8px). | ||||||||||||||||||||||||||||||
From Base UIToggleGroupBase UI docs | |||||||||||||||||||||||||||||||||
| value | readonly Value[] | — | The pressed state of the toggle group represented by an array of the values of all pressed toggle buttons. This is the controlled counterpart of defaultValue. | ||||||||||||||||||||||||||||||
| default | readonly Value[] | — | The pressed state of the toggle group represented by an array of the values of all pressed toggle buttons. This is the uncontrolled counterpart of value. | ||||||||||||||||||||||||||||||
| on | — | Callback fired when the pressed states of the toggle group changes. | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | ||||||||||||||||||||||||||||||
ToggleGroupItem
<button>| Prop | Type | Default | Description | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | ||||||||||||||||||||||||||||||
| size | "default""lg""sm""xs" | — | Height 24, 28, 32, or 36px. | |||||||||||||||||||||||||||||
| rounded | "default""full" | — | ||||||||||||||||||||||||||||||
From Base UIToggleBase UI docs | ||||||||||||||||||||||||||||||||
| pressed | boolean | — | Whether the toggle button is currently pressed. This is the controlled counterpart of defaultPressed. | |||||||||||||||||||||||||||||
| default | boolean | false | Whether the toggle button is currently pressed. This is the uncontrolled counterpart of pressed. | |||||||||||||||||||||||||||||
| disabled | boolean | false | Whether the component should ignore user interaction. | |||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | |||||||||||||||||||||||||||||
ToggleGroupTile
<button>| Prop | Type | Default | Description | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | ||||||||||||||||||||||||||||||
| size | "default""lg""sm" | — | sm 56 × 40, default 72 × 48, or lg 88 × 56. Default: from the group size. | |||||||||||||||||||||||||||||
| media | boolean | false | A square picture tile (#/lib/tile media): the box holds a sample <img> that fills it, and the 2px pressed edge draws over it. Default false. | |||||||||||||||||||||||||||||
From Base UIToggleBase UI docs | ||||||||||||||||||||||||||||||||
| pressed | boolean | — | Whether the toggle button is currently pressed. This is the controlled counterpart of defaultPressed. | |||||||||||||||||||||||||||||
| default | boolean | false | Whether the toggle button is currently pressed. This is the uncontrolled counterpart of pressed. | |||||||||||||||||||||||||||||
| disabled | boolean | false | Whether the component should ignore user interaction. | |||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | |||||||||||||||||||||||||||||
ToggleGroupTileBox
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
ToggleGroupTileCaption
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
| Tab | Moves focus to the group. It has one tab stop. |
|---|---|
| Left ArroworRight ArroworUp ArroworDown Arrow | Moves the focus. It does not change the value. Right to left flips the sides. |
| HomeorEnd | Goes to the first or the last item. |
| EnterorSpace | Presses the focused item. |
- ToggleA button that stays on or off, such as Bold, Mute, or Pin. It has two looks, four sizes, and the same shape as Button.
- Segmented ControlPick Segmented Control for one choice from a few attached options that always has a value.
- Radio GroupPick one option from a short list. Each option is a round radio with its label, or a larger tile with a picture.
- TabsPick Tabs to switch between views or panels of one thing.
Built with
Installs with Toggle Group
- Components
- Toggle







