Mobile › Inputs
SegmentedControl
Two to five equal options in one row, such as Day, Week and Month.
Installation
npx expo install plankui-mobile react-native-safe-area-context expo-hapticsUsage
import { SegmentedControl } from "plankui-mobile";
const [range, setRange] = useState(0);
<SegmentedControl options={["Day", "Week", "Month"]} value={range} onChange={setRange} accessibilityLabel="Range" />iOS and Android
iOS: A grey track with a white thumb that slides to the selection.
Android: Material 3 segmented buttons: outlined, with a check on the selected one.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| options | string[] | Two to five labels. | |
| value | number | Index of the selected option. | |
| onChange | (index: number) => void | Called with the tapped index. | |
| accessibilityLabel | string | – | Names the group for screen readers. |