This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 58).
Switch
A Jetpack Compose Switch component for toggle controls.
For cross-platform usage, see the universal
Switch— it renders the appropriate native component per platform.
Expo UI Switch matches the official Jetpack Compose Switch API.


Installation
If you are installing this in an existing React Native app, make sure to install expo in your project.
Usage
Toggle switch
Custom colors
Custom thumb content
Use Switch.ThumbContent to render a custom element inside the thumb. Switch.DefaultIconSize gives you the M3 default icon size so your content fits perfectly.
Labeled switch
To make the whole row tappable and have screen readers read the label with the switch, apply the toggleable modifier to the Row. Handle the change in toggleable and do not pass onCheckedChange to the Switch.
Without onCheckedChange, the switch loses its 48 dp minimum touch size. Use defaultMinSize to keep it.
import { useState } from 'react'; import { Host, Row, Switch, Text } from '@expo/ui/jetpack-compose'; import { defaultMinSize, toggleable, weight, } from '@expo/ui/jetpack-compose/modifiers'; export default function LabeledSwitchExample() { const [checked, setChecked] = useState(false); return ( <Host matchContents> <Row verticalAlignment="center" modifiers={[ toggleable(checked, () => setChecked(!checked), { role: 'switch', }), ]}> <Text modifiers={[weight(1)]}>Wi-Fi</Text> <Switch value={checked} modifiers={[ defaultMinSize({ minWidth: 48, minHeight: 48 }), ]} /> </Row> </Host> ); }
API
import { Switch } from '@expo/ui/jetpack-compose';
Components
Type: React.Element<SwitchProps>
A switch component.
(value: boolean) => voidCallback function that is called when the checked state changes.
When omitted, the switch is not interactive on its own, so a parent with the
toggleable modifier can handle input and accessibility for it.
Type: React.Element<ThumbContentProps>
Custom content to be displayed inside the switch thumb.