Segmented Control
UI SDK SegmentedControl: one choice from a row of buttons with a sliding indicator, like a board/table view switch.
Example
segmented-control-demo.tsxCopy code
Installation
Copy code
Usage
ImportCopy code
API reference
SegmentedControl
Takes SegmentedControlProps<T>.
SegmentedControlIndicator
SegmentedControlItem
Other exports
createSegmentedControlControllertype SegmentedControlPropstype SegmentedControlControllertype SegmentedControlItemStateAccessibility
- One choice from a row, as a radio group: arrow keys move and select.
- The indicator slides, or fades under reduced motion.
- activateOnPress (off by default) checks an item on a mouse or pen press instead of on release, like macOS. Touch stays on release, so scrolling past doesn't change it. WCAG 2.5.2 allows it because another press undoes it; actions and menus always activate on release.
Agent actions
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.