Back to docs
Component
Toggle Switch
Compact switch with smooth thumb motion and custom colors.
Install
npx shadcn@latest add @native-bits/toggle-switchDependencies
react-native-reanimated
controlssettingsmobile
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| value | boolean | - | Active state |
| onToggle | (value: boolean) => void | - | Toggle callback |
| size | 'sm' | 'md' | 'lg' | 'md' | Switch size |
Usage
```tsx
import { toggle-switch } from '@/components/native-bits/toggle-switch'
<ToggleSwitch value={enabled} onToggle={setEnabled} />
```Source code
Loading...