Raw
1 import { ComponentExample } from "@/components/ComponentExample"
2 import { ComponentReference } from "@/components/ComponentReference"
3
4 export const metadata = {
5 title: `Switch`,
6 }
7
8 # {metadata.title}
9
10 A component for toggling between two states, typically on and off. It's essentially a checkbox in the form of a switch.
11
12 In this guide, you'll learn how to use the Switch component.
13
14 <ComponentExample name="switch-demo" />
15
16 ## Usage
17
18 ```tsx
19 import { Switch } from "@medusajs/ui"
20 ```
21
22 ```tsx
23 <Switch />
24 ```
25
26 ---
27
28 ## API Reference
29
30 <ComponentReference mainComponent="Switch" />
31
32 ---
33
34 ## Examples
35
36 ### Switch Sizes
37
38 <ComponentExample name="switch-all-sizes" />
39
40 ### Controlled Switch
41
42 <ComponentExample name="switch-controlled" hideFeedback />
43
44 ### Disabled Switch
45
46 <ComponentExample name="switch-disabled" />