A segmented control that automatically detects its orientation from its container dimensions. Options accept a SliderOption object (label + optional textProps) instead of plain strings.
Unlike ButtonsSlider, orientation is detected automatically from the rendered width/height of the container. A wider container becomes horizontal; a taller one becomes vertical.
SliderOption type
ts
typeSliderOption={label:string;textProps?:TextProps;// any React Native TextInput props};
Use textProps to control text overflow, font, and other label characteristics per option.
Props
Prop
Type
Default
Description
options
req
SliderOption[]
—
Array of { label, textProps? } objects.
initialIndex
req
number
—
Initially selected index.
onSelect
req
(index: number) => void
—
Called when selection changes.
style
ViewStyle
—
Container style — determines the orientation via width/height ratio.