SegmentedControl
SegmentedControl component for toggling two values or more
(code example)
Usageβ
<SegmentedControl segments={[{label: '1st'}, {label: '2nd'}]}/>
APIβ
activeBackgroundColorβ
The background color of the active segment
string
activeColorβ
The color of the active segment label
string
backgroundColorβ
The background color of the inactive segments
string
borderRadiusβ
The segmentedControl borderRadius
number
containerStyleβ
Additional spacing styles for the container
ViewStyle
iconOnRightβ
Should the icon be on right of the label
boolean
initialIndexβ
Initial index to be active
number
labelβ
SegmentedControl label
string
labelPropsβ
Pass props for the SegmentedControl label
TextProps
onChangeIndexβ
Callback for when index has change.
(index: number) => void
outlineColorβ
The color of the active segment outline
string
outlineWidthβ
The width of the active segment outline
number
segmentLabelStyleβ
Segment label style
TextStyle
segmentsβ
Array on segments
SegmentedControlItemProps
segmentsStyleβ
Additional style for the segments
ViewStyle
styleβ
Custom style to inner container
ViewStyle
testIDβ
Component test id
string
throttleTimeβ
Trailing throttle time of changing index in ms.
number