Toggle

A toggle button that switches between on and off states.

@radix-ui/react-toggle

lucide-react

Installation


1

Install the following dependencies:

npx shadcn@latest add https://sbthemes.com/r/toggle.json

Examples


Default

Outline

Size

Disabled


API Reference

Root

The toggle.

PropTypeDefault
asChildbooleanfalse
disabledboolean-
Data attributeValues
[data-state]on, off
[data-disabled]Present when disabled