A switch with a spring-driven knob that squashes on press and bounces into place.
pnpm dlx shadcn@latest add https://matos-ui.com/r/bouncy-toggle.jsonimport { BouncyToggle } from '@/components/matos-ui/bouncy-toggle'const [checked, setChecked] = useState(true)
<BouncyToggle checked={checked} onCheckedChange={setChecked} />| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | - | Controlled state. |
defaultChecked | boolean | false | Initial state when uncontrolled. |
onCheckedChange | (checked: boolean) => void | - | Fires when the state changes. |
size | "sm" | "md" | "lg" | "md" | Track and knob size preset. |
disabled | boolean | false | Disables interaction. |
stiffness | number | 500 | Spring stiffness for the knob motion. |
damping | number | 15 | Spring damping for the knob motion. |
Install Matos UI
Choose a package manager and copy one command for every component.