Forms
SegmentedControl
Exclusive choice between a few options with a sliding indicator.
import { SegmentedControl } from "datui";Playground
<SegmentedControl size="l" />Examples
Sizes
Accessibility
- Radio group semantics (Radix RadioGroup): Tab focuses the selected option, arrow keys move and select (RTL-aware).
- Name it with
aria-labeloraria-labelledby.
API
SegmentedControl
Exclusive choice between a few equal-width options with a sliding indicator. `radiogroup` semantics (Radix RadioGroup): Tab focuses the selected option, arrow keys move and select.
| Prop | Type | Default | Description |
|---|---|---|---|
| options (required) | SegmentedControlOptionData[] | — | |
| className | string | — | |
| defaultValue | SegmentedControlValue | the first option | |
| disabled | boolean | — | |
| name | string | — | Form field name. |
| onChange | ((value: SegmentedControlValue) => void) | — | |
| size | "m" | "l" | l | |
| value | SegmentedControlValue | — |