Components · Interactive
Toggle
StableAdded v0.0.1
Pressable toggle button built on Radix UI Toggle.
import { Toggle } from '@nexub/react';Playground
Props
variant
size
<Toggle>Bold</Toggle>Examples
Default
Outline variants
States
defaultdisabledsize="sm"size="md"size="lg"variant="outline"variant="default"
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| pressed | boolean | — | The controlled pressed state. |
| defaultPressed | boolean | — | The initial pressed state when uncontrolled. |
| variant | 'outline' | 'default' | 'default' | Visual style of the toggle button. |
| size | 'sm' | 'md' | 'lg' | 'md' | 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.