--- title: Switch description: A control that allows the user to toggle between checked and not checked. base: base component: true links: doc: https://base-ui.com/react/components/switch api: https://base-ui.com/react/components/switch#api-reference --- ## Installation Command Manual ```bash npx shadcn@latest add switch ``` Install the following dependencies: ```bash npm install @base-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage ```tsx import { Switch } from "@/components/ui/switch" ``` ```tsx ```