Files
shadcn-ui/apps/www/content/docs/components/toggle.mdx
2023-06-22 22:44:52 +04:00

59 lines
833 B
Plaintext

---
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
---
<ComponentPreview name="toggle-demo" />
## Installation
<Steps>
### Command
```bash
npx shadcn-ui add toggle
```
### Usage
```tsx
import { Toggle } from "@/components/ui/toggle"
```
```tsx
<Toggle>Toggle</Toggle>
```
</Steps>
## Examples
### Default
<ComponentPreview name="toggle-demo" />
### Outline
<ComponentPreview name="toggle-outline" />
### With Text
<ComponentPreview name="toggle-with-text" />
### Small
<ComponentPreview name="toggle-sm" />
### Large
<ComponentPreview name="toggle-lg" />
### Disabled
<ComponentPreview name="toggle-disabled" />