An exclusive-select toggle switch for any number of options, with icons, labels, and a dedicated off state.
npx shadcn@latest add https://your-domain.com/r/n-way-switch.json| Prop | Type | Default | Description |
|---|---|---|---|
| options | NWaySwitchOption[] | required | The segments to render. Each needs a value, a label, and an icon. |
| value | string | - | Selected value, for controlled use. |
| defaultValue | string | first option | Selected value, for uncontrolled use. |
| onValueChange | (value: string) => void | - | Called when the selection changes. |
| collapsible | "none" | "labels" | "full" | "none" | Controls whether labels show inline, in a tooltip, or the switch collapses to one icon. |
| disabled | boolean | false | Disables the whole switch. |
| aria-label | string | - | Accessible name for the switch group. |
| options[].isOff | boolean | false | Marks this option as the off position. Selecting it renders without the on fill. |