The following props are available for switch component. These are the custom props that come with we've added for the switch component and you can use all the other native input props as well.
Attribute | Type | Description | Default |
---|---|---|---|
color | Color | Change switch color | blue |
label | string | Add label for switch | '' |
ripple | boolean | Add ripple effect for switch | true |
className | string | Add custom className for switch | '' |
containerProps | object | Add custom props for switch container | undefined |
labelProps | object | Add custom props for switch label | undefined |
circleProps | object | Add custom props for switch circle | undefined |
import type { SwitchProps } from "@material-tailwind/react";
type color =
| "blue-gray"
| "gray"
| "brown"
| "deep-orange"
| "orange"
| "amber"
| "yellow"
| "lime"
| "light-green"
| "green"
| "teal"
| "cyan"
| "light-blue"
| "blue"
| "indigo"
| "deep-purple"
| "purple"
| "pink"
| "red";