Toggle

A two-state button that can be either on or off.

shadcn/ui docs →

Preview

Installation

terminal
$
Other package managers
bunx --bun shadcn@latest add https://trents.tech/r/toggle.json

Dependencies: @radix-ui/react-toggle

Usage

example.tsx
import { Toggle } from "@/components/ui/toggle"
import { Bold } from "lucide-react"

<Toggle aria-label="Toggle bold">
  <Bold className="size-4" />
</Toggle>
0