Founding price: $35, then $99 after 23:59 UTC on 4 November, then $99
Get ProOne choice control that shows a segmented control when the options fit in the available width and a select when they do not, measured with a ResizeObserver, keeping the same value, label and keyboard behaviour in both. Use this when a short list of options must work in wide and narrow containers.
Derived from this item’s props table, because it declares no controls of its own. This item has no standalone playground, so changes update the code, the share link and the AI prompt.
Use it for view modes, ranges and sort orders in toolbars that live in sidebars, cards and full pages, where the same control should be buttons when there is room and a dropdown when there is not.
Do not use it when there are more than six options or the labels are long. Always use a select.
This item is part of tealmac UI Pro
The source for this item installs with a Pro licence key. Log in with your key to see the install command, or read the Pro setup page.
| Prop | Type | Default | Description |
| ----------------- | ------------------------- | -------------- | ---------------------------------------------------------------- | ------ | ------------- |
| options | { value, label }[] | - | The choices. |
| value | string | - | Selected value (controlled). |
| defaultValue | string | first | Initial value. |
| onValueChange | (value: string) => void | - | Runs on change. |
| label | string | - | Visible label, shared by both modes. |
| minSegmentWidth | number | 88 | Width in pixels each segment needs; below it the select is used. |
| mode | "auto" \\ | "segmented" \\ | "select" | auto | Force a mode. |
ToggleGroup (single) named by the label; select mode is the Radix select with the same name.mode="auto" the first render (before measuring) is the segmented control on the server and the correct one after mount.The pattern ships with a Testing Library test (responsive-segmented-or-select.test.tsx) that covers choosing in both modes, the mode following the container width and a forced mode.