Switch
Switch component is same as the Switch component but used separately & used to toggle a single value.
Imports
import {
Switch,
SwitchDescription,
SwitchIcon,
SwitchInput,
SwitchLabel,
useSwitchProps,
useSwitchState,
SwitchText,
} from "@renderlesskit/react-tailwind";
💡
A complex component that supports customization as per the composition guide.
Usage
Switch sizes
Sizes can be set using the size
prop. The default size is md
. The available
sizes are: sm
md
lg
Switch Uncontrolled
Uncontrolled switch can be used with defaultState
prop.
Switch UI states
Switch Disabled states
API Reference
Prop | Type | Default |
---|---|---|
size | union | md |
disabled | boolean | false |
isChecked | boolean | false |
label | React.ReactNode | - |
description | React.ReactNode | - |
icon | React.ReactNode | - |