Bouncy Toggle

PreviousNext

A switch with a spring-driven knob that squashes on press and bounces into place.

Wi-Fi
Background sync

Installation

pnpm dlx shadcn@latest add https://matos-ui.com/r/bouncy-toggle.json

Usage

import { BouncyToggle } from '@/components/matos-ui/bouncy-toggle'
const [checked, setChecked] = useState(true)

<BouncyToggle checked={checked} onCheckedChange={setChecked} />

Reference

BouncyToggle Props

PropTypeDefaultDescription
checkedboolean-Controlled state.
defaultCheckedbooleanfalseInitial state when uncontrolled.
onCheckedChange(checked: boolean) => void-Fires when the state changes.
size"sm" | "md" | "lg""md"Track and knob size preset.
disabledbooleanfalseDisables interaction.
stiffnessnumber500Spring stiffness for the knob motion.
dampingnumber15Spring damping for the knob motion.