51 lines
931 B
Plaintext
51 lines
931 B
Plaintext
---
|
|
title: Switch
|
|
description: Let users to turn on or off your marketing emails or notifications.
|
|
lastUpdated: 09 Sep, 2025
|
|
links:
|
|
api_reference: https://www.radix-ui.com/primitives/docs/components/switch#api-reference
|
|
source: https://github.com/logging-studio/RetroUI/blob/main/components/retroui/Switch.tsx
|
|
---
|
|
|
|
<ComponentShowcase name="switch-style-default" />
|
|
<br />
|
|
<br />
|
|
|
|
## Installation
|
|
|
|
<ComponentInstall>
|
|
<ComponentInstall.Cli npmCommand="npx shadcn@latest add @retroui/switch" />
|
|
<ComponentInstall.Manual>
|
|
|
|
#### 1. Install dependencies:
|
|
|
|
```sh
|
|
npm install @radix-ui/react-switch
|
|
```
|
|
|
|
<br />
|
|
|
|
#### 2. Copy the code 👇 into your project:
|
|
|
|
<ComponentSource name="switch" />
|
|
|
|
</ComponentInstall.Manual>
|
|
</ComponentInstall>
|
|
|
|
<br />
|
|
<br />
|
|
|
|
## Examples
|
|
|
|
### Default
|
|
|
|
<ComponentShowcase name="switch-style-default" />
|
|
<br />
|
|
<br />
|
|
|
|
### Disabled
|
|
|
|
<ComponentShowcase name="switch-style-disabled" />
|
|
<br />
|
|
<br />
|