--- title: Toggle description: A two-state button that can be either on or off. base: aria component: true links: doc: https://react-aria.adobe.com/ToggleButton api: https://react-aria.adobe.com/ToggleButton#api --- ## Installation Command Manual ```bash npx shadcn@latest add toggle ``` Install the following dependencies: ```bash npm install react-aria-components ``` 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 ``` ## Outline Use `variant="outline"` for an outline style. ## With Text ## Size Use the `size` prop to change the size of the toggle. ## Disabled ## RTL To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). ## API Reference See the [React Aria ToggleButton](https://react-aria.adobe.com/ToggleButton#api) documentation.