components

Toggle

A button that toggles between two states, such as on/off or show/hide.

Source CodeRadix UI

Installation

pnpm dlx radianui@latest add toggle

Usage

Imports

/components/ui/toggle.tsx
import { Toggle } from "@/components/ui/toggle"

Code

/components/ui/toggle.tsx
<Toggle>Toggle</Toggle>

Examples

Variants

Sizes

Favorite

Formatting Toolbar

Notifications

With Heart

Disabled

Props

<Toggle>
NameDefaultValues
variantoutlineghostoutline
size32283236404448
pressedundefinedboolean
defaultPressedfalseboolean
onPressedChange-(pressed: boolean) => void
disabledfalseboolean
asChildfalseboolean
External Reference--