2.0 alpha
These docs describe 2.0. Install it with @once-ui-system/core@alpha.
On 1.8.x? Read the 1.x docs
TrademarkTrademarkDocs
Ctrl k
Search docs...
Components

SegmentedControl

Updated: May 9, 2025
View on GitHub
Use this component for toggle-style selection between discrete options. It supports keyboard interaction, styling, and controlled or uncontrolled usage. Use selected to manage the selected state from the parent. Use defaultValue to define an initial active button in uncontrolled mode. Don't use it along with the value prop. Use compact to create a compact variant. Control the selected value externally with the value prop. Distribute the button widths evenly across the container.
Prop
Type
Default
buttonsrequired
ButtonOption[]
onChangerequired
(value: string, event?: React.MouseEvent<HTMLButtonElement>) => void
defaultValue
string
fillWidth
booleantrue
value
string
compact
Tighter padding, for dense toolbars.
booleanfalse
className
string
style
React.CSSProperties
…and every FlexProps propinherited
…and every ScrollerProps propinherited
Edit this page on GitHub
TrademarkTrademark
Built with curiosity by Lorant One and the Design Engineers Club