Segmented Control

Picks one of two to five short options, as joined buttons.

The snippet an agent gets

SegmentedControl.tsx
import { SegmentedControl } from '@basiiik/ui';<SegmentedControl options={[{ value: 'list', label: 'List' }, { value: 'board', label: 'Board' }]} aria-label="View" />

From get_component_snippet, with the required props filled in from the spec. Every snippet is type-checked against the library before it ships.

  • Example values were filled in for the required props options, aria-label: replace them with your own.
  • Values in braces are your own variables, handlers or data, such as const [open, setOpen] = useState(false).
  • Hover is CSS; Focused is :focus-visible on the native radio, drawn on its label; Disabled uses the disabled prop (all options) or an option's disabled; the chosen option follows value or defaultValue.
  • Storybook: Inputs/Segmented control.