Component
SegmentedControl
iOS-style single-select switch. Options can be plain strings or { label, value } objects.
jsx
const [segment, setSegment] = useState('day');
<SegmentedControl
options={[
{ label: 'Day', value: 'day' },
{ label: 'Week', value: 'week' },
{ label: 'Month', value: 'month' },
]}
value={segment}
onChange={setSegment}
/>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
options
|
string[] \ | { label, value }[] | `[]` |
value
|
string | — | Currently selected value. |
onChange
|
(value) => void | — | Called with the new value on tap. |