Applies to every preview on the site.
Installation
One command copies the source into your app — you own the code and can change anything.
After you add the file, import it like any local component:
import { SegmentedControl } from "@/components/ui/segmented-control";Or add it with the CLI (installs any missing peers):
Usage
useKit(). Wrap your app in <KitProvider accent="#6366f1" radius={14}> to re-skin every component at once.Like this? There's a lot more in Pro Pro
12 full screens built from the same kit — install them the same way.
Props
| Prop | Type | Default |
|---|---|---|
| options Segments. `icon` can be a node or ({ active, color }) => node. | (string | { value, label?, icon?, disabled? })[] | — |
| value / onValueChange Controlled selection (or use defaultValue; defaults to the first segment). | string | — |
| defaultValue Initial selection when uncontrolled. | string | first segment |
| variant Raised pill on a track, tab underline, or tinted outline. | "pill" | "underline" | "outline" | "pill" |
| size 32 / 40 / 48pt tall. | "sm" | "md" | "lg" | "md" |
| fullWidth Equal-width segments filling the row, or segments sized to their labels. | boolean | true |
| accent Indicator colour (pill becomes a filled accent pill). | string | theme accent |
| haptics Selection tick on change. | boolean | true |
| disabled Dims and blocks presses. | boolean | false |
| style Style for the track holding the segments. | StyleProp<ViewStyle> | — |
| className Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. | string | — |
Customization
You own the source file — tune appearance with props (no fork required for most tweaks). For brand-wide colours and radius, wrap your app in KitProvider; for one-off looks, use the style props below.
Design theme
Open Design theme on the live preview — accent, corner radius and font update every variant instantly (same as KitProvider in your app).
Variants
Pick the Variants chip above the preview, or set variant=… — "pill" | "underline" | "outline".
Style props
React Native style and typed slots like fieldStyle, plus optional root className when you use NativeWind or Uniwind (cnProps from kit).
- variant
- "pill" | "underline" | "outline" · default "pill"Raised pill on a track, tab underline, or tinted outline.
- size
- "sm" | "md" | "lg" · default "md"32 / 40 / 48pt tall.
- accent
- string · default theme accentIndicator colour (pill becomes a filled accent pill).
- style
- StyleProp<ViewStyle>Style for the track holding the segments.
- className
- stringTailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides.
Map tokens from your design system on Bring your design system or read Theming for KitProvider and NativeWind / Uniwind setup.
Behaviour & accessibility
- Motion
- The leading edge of the indicator springs ahead and the trailing edge catches up, so it stretches as it travels. Labels squish on press and bounce when selected.
- Touch
- A sideways drag that starts on the selected segment scrubs across the others; drags that start elsewhere are left to a parent ScrollView. Short segments get hitSlop up to 44pt.
- Haptics
- A selection tick plays on each change (haptics, on by default).
- Screen readers
- A tablist of tabs with selected and disabled state, labelled by each option's label or accessibilityLabel.
Source
FAQ
How do I make a segmented button in React Native?
npx @expokit/cli@latest add segmented-control in your Expo or React Native project and it copies a ready-made segmented button into your app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.Does Segmented Control work in Expo Go?
react-native-svg, expo-haptics) are all included in Expo Go.How do I add Segmented Control to my Expo app?
npx @expokit/cli@latest add segmented-control in your project. The CLI copies the component's source into your app and installs react-native-svg, expo-haptics, so the code is yours to change.Is Segmented Control free?
Can I change how Segmented Control looks?
useKit(), so wrapping your app in <KitProvider accent radius> re-skins it with every other ExpoKit component. The code lives in your project, so you can also edit anything directly.