Components · Interactive
Toggle
StableSince v0.0.1
Pressable toggle button built on Radix UI Toggle.
import { Toggle } from '@nexub/react';Examples
Default
Outline variants
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| pressed | boolean | — | The controlled pressed state. |
| defaultPressed | boolean | — | The initial pressed state when uncontrolled. |
| variant | 'default' | 'outline' | — | Visual style of the toggle button. |
| size | 'sm' | 'md' | 'lg' | — | Size of the toggle button. |
| disabled | boolean | — | Disables the toggle when true. |
On iOS & Android
Web only
Toggle has no @nexub/react-native twin. On phones, follow the platform pattern instead, or compose it from the native components listed on the React Native page.