--- title: Toggle description: A two-state button that can be either on or off. component: true radix: link: https://www.radix-ui.com/docs/primitives/components/toggle api: https://www.radix-ui.com/docs/primitives/components/toggle#api-reference --- ## Installation ```bash npx shadcn-ui add toggle ``` Manual Installation 1. Install the `@radix-ui/react-toggle` component from radix-ui: ```bash npm install @radix-ui/react-toggle ``` 2. Copy and paste the following code into your project. This is the `` primitive. You can place it in a file at `components/ui/toggle.tsx`. ## Usage ```tsx import { Toggle } from "@/components/ui/toggle" ``` ```tsx Toggle ``` ## Examples ### Default --- ### Outline --- ### With Text --- ### Small --- ### Large --- ### Disabled