This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Switch
A Jetpack Compose Switch component for toggle controls.
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.
API
import { Switch } from '@expo/ui/jetpack-compose';
Components
Type: React.Element<SwitchProps>
stringLabel for the switch.
On Android, the label has an effect only when the
Switchis used inside aContextMenu.
(value: boolean) => voidCallback function that is called when the checked state changes.
Type: React.Element<ThumbContentProps>
Custom content to be displayed inside the switch thumb.