datui
Color scheme

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-label or aria-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.

PropTypeDefaultDescription
options (required)SegmentedControlOptionData[]—
classNamestring—
defaultValueSegmentedControlValuethe first option
disabledboolean—
namestring—Form field name.
onChange((value: SegmentedControlValue) => void)—
size"m" | "l"l
valueSegmentedControlValue—