Switch
The Switch component is used to toggle on/off.
1. Import
KUMUI exports 1 Switch-related components:
import { Switch } from "@rohitgadekar/kimui";
2. Usage
3 API
3.1 Switch
| Attribute | Type | Description | Default |
|---|---|---|---|
| children | React.ReactNode | Label or content inside the switch (optional). | - |
| checked | boolean | Indicates whether the switch is turned on (true) or off (false). | false |
| onChange | (value: boolean) => void | Callback function triggered when the switch is toggled. | - |
| disabled | boolean | Disables the switch, preventing user interaction. | false |
| size | "small" | "medium" | "large" | Defines the size of the switch. Options: "small", "medium", "large". | "medium" |