A switch component with smooth animations.
Dependencies
framer-motion
Installation
npm install framer-motion
Props
Name | Type | Default | Description |
---|---|---|---|
id | string | - | Unique identifier for the switch input. |
name | string | - | Name attribute for the switch input. |
checked | boolean | false | Indicates whether the switch is toggled on. |
onChange | (event: React.ChangeEvent<HTMLInputElement>) => void | - | Callback function triggered when the switch state changes. |
label | string | '' | Label text for the switch. |
className | string | '' | Additional CSS classes to apply to the switch container. |