--- title: Toggle description: A two-state button that can be either on or off. component: true links: doc: https://www.radix-ui.com/docs/primitives/components/toggle api: https://www.radix-ui.com/docs/primitives/components/toggle#api-reference --- ## Installation CLI Manual ```bash npx shadcn@latest add toggle ``` Install the following dependencies: ```bash npm install @radix-ui/react-toggle ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage ```tsx import { Toggle } from "@/components/ui/toggle" ``` ```tsx Toggle ``` ## Examples ### Default ### Outline ### With Text ### Small ### Large ### Disabled