Switch
Toggle switch component for boolean values.
Basic
Simple switch
Sizes
Different sizes
Label Position
Label placement options
Main Props
Name | Type | Default | Description |
---|---|---|---|
id | string | - | HTML id attribute |
checked | boolean | - | Checked state |
onCheckedChange | (checked: boolean) => void | - | Change handler |
disabled | boolean | false | Disable the switch |
size | 'sm' | 'md' | 'lg' | 'md' | Switch size |
label | string | - | Label text |
labelPosition | 'left' | 'right' | 'left' | Position of the label |
Class Props
Name | Type | Default | Description |
---|---|---|---|
className | string | - | Class for wrapper |
classNameLabel | string | - | Class for label |
classNameSwitch | string | - | Class for switch button |