React Native Switch for Expo

Install

Switch · IOS, native in Expo Go — the other variants are a tap away. No account needed.

Needs Expo Go for SDK 58 — update from the App Store or Play Store.

A toggle whose thumb squashes and stretches toward the other side while held.

iOS · Android · Expo Go
9:41

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:

App.tsx
import { Switch } from "@/components/ui/switch";

Or add it with the CLI (installs any missing peers):

Usage

Colours, radius and light / dark come from 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.

See what's in Pro

Props

PropTypeDefault
value / onValueChange

Controlled state (or use defaultValue).

boolean—
defaultValue

Initial state when uncontrolled.

booleanfalse
variant

Look of the track and thumb.

"ios" | "material" | "icon""ios"
size

24 / 31 / 38pt tall.

"sm" | "md" | "lg""md"
icon

Sun / moon or ✕ / check inside the thumb (variant="icon").

"theme" | "check""theme"
label

Turns it into a settings row with the switch on the right.

string—
description

Secondary line under the label.

string—
accent

Track colour when on.

stringtheme accent
haptics

Light tap when it flips.

booleantrue
disabled

Dims and blocks presses.

booleanfalse
style

Style for the pressable — the switch itself, or the whole settings row when label is set.

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=… — "ios" | "material" | "icon".

Style props

React Native style and typed slots like fieldStyle, plus optional root className when you use NativeWind or Uniwind (cnProps from kit).

variant
"ios" | "material" | "icon" · default "ios"Look of the track and thumb.
size
"sm" | "md" | "lg" · default "md"24 / 31 / 38pt tall.
accent
string · default theme accentTrack colour when on.
style
StyleProp<ViewStyle>Style for the pressable — the switch itself, or the whole settings row when label is set.
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

Touch
Tap to flip, or drag the thumb across. Passing label (and description) turns it into a settings row.
Motion
The thumb stretches toward its destination while pressed, springs over with a soft halo, and the track cross-fades.
Haptics
A light impact on every flip; turn it off with haptics={false}.
Screen readers
A switch role with checked and disabled state, labelled by accessibilityLabel or label.

Source

FAQ

How do I make a toggle switch in React Native?
Use ExpoKit's Switch: run npx @expokit/cli@latest add switch in your Expo or React Native project and it copies a ready-made toggle switch into your app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.
Does Switch work in Expo Go?
Yes. Switch runs in Expo Go on iOS and Android with no development build — its packages (react-native-svg, expo-haptics) are all included in Expo Go.
How do I add Switch to my Expo app?
Run npx @expokit/cli@latest add switch 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 Switch free?
Yes. Switch is free: its full source is on this page and the CLI installs it without an account.
Can I change how Switch looks?
Yes. It takes its colours, radius and light / dark mode from 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.