apps/v4/content/docs/components/radix/toggle.mdx
npx shadcn@latest add toggle
<Step>Install the following dependencies:</Step>
npm install radix-ui
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="toggle" title="components/ui/toggle.tsx" styleName="radix-nova" />
<Step>Update the import paths to match your project setup.</Step>
</Steps> </TabsContent> </CodeTabs>import { Toggle } from "@/components/ui/toggle"
<Toggle>Toggle</Toggle>
Use variant="outline" for an outline style.
Use the size prop to change the size of the toggle.
To enable RTL support in shadcn/ui, see the RTL configuration guide.
<ComponentPreview styleName="radix-nova" name="toggle-rtl" direction="rtl" />See the Radix Toggle documentation.