Ripple Switch

A switch with a ripple effect animation.

Dependencies

framer-motion

Installation

npm install framer-motion

Props

NameTypeDefaultDescription
checkedbooleanfalseIndicates whether the switch is toggled on.
onChange(event: React.ChangeEvent<HTMLInputElement>) => void-Callback function triggered when the switch state changes.
labelstring''Label text for the switch.
idstring-Unique identifier for the switch input.
namestring-Name attribute for the switch input.
classNamestring''Additional CSS classes to apply to the switch container.
Brought to life by Naseem Ansari – Building Experiences that Inspire