Skip to content
PixiKit

Segmented Control

A row of options with a pill that slides and resizes to the one you pick. Arrow keys move the choice.

pixikit.com/docs/components/segmented-control

Customize

Orientation
Height45px
Padding4px
Item padding x14px
Gap0px
Radius14px
Pill radius10px
Font size12.0px
Font weight400
Duration0.30s
Easing
Track color
Border color
Border width1.0px
Pill color
Text color
Active text color
Full width
Disabled

Props

27
NameTypeDefaultDescription
optionsstring[]DEFAULT_OPTIONSThe choices, in order.
valuestringNoneThe chosen option, when you hold the state.
defaultValuestringNoneThe option chosen at first, when the control holds the state.
onValueChange(value: string) => voidNoneCalled with the option the user picks.
disabledOptionsstring[][]Options that cannot be picked.
orientation"row" | "column""row"`row` lays the options side by side, `column` stacks them.
heightnumber45Control height in a row, and the height of each option in a column, in px.
paddingnumber4Space between the track edge and the options, in px.
itemPaddingXnumber14Space left and right of each label, in px.
gapnumber0Space between options, in px.
radiusnumber14Corner radius of the track, in px.
pillRadiusnumber10Corner radius of the sliding pill, in px.
fontSizenumber12Label size, in px.
fontWeightnumber400Label weight.
durationnumber0.3Seconds the pill takes to slide and resize.
easing"ease" | "ease-out" | "ease-in-out" | "spring" | "linear""ease"How the pill moves.
trackColorstring"transparent"Track fill.
borderColorstring"var(--border)"Track border colour.
borderWidthnumber1Track border width, in px.
pillColorstring"var(--muted)"Fill of the sliding pill.
textColorstring"var(--muted-foreground)"Label colour of the options that are not chosen.
activeTextColorstring"var(--foreground)"Label colour of the chosen option.
fullWidthbooleanfalseStretches the control to its container and shares the width between the options.
disabledbooleanfalseTurns the whole control off.
ariaLabelstring"Options"Name for the group, read by screen readers.
classNamestring""
styleCSSPropertiesNone

More forms components in Pro

View all

Related