Vybe Sync
Tools
Color ContrastDesign Spy
Animations
ButtonsCards
InputsLoaders
TogglesCheckbox
Radio
Resources
Chrome ExtensionFigma Plugin
Company
BlogAbout Us
← Checkbox

Bounce

No library Beginner

A checkbox that plays a spring-bounce keyframe animation on the box itself when toggled — compresses then overshoots on check, lightly expands then settles on uncheck. Fill and border color transition simultaneously.

LLM Prompt
Goal: Create a "Bounce" checkbox animation.

Visual behavior: A 28×28px square checkbox (7px border-radius). Off state: transparent fill, white/25% border. On state: indigo (#6366f1) fill and border. When toggled, the entire box plays a CSS keyframe spring-bounce animation — on check: compress (scale 0.8) then overshoot (scale 1.22) then settle; on uncheck: slight expand (scale 1.14) then compress (scale 0.93) then settle. The fill color and check mark opacity transition simultaneously. The check is a simple white SVG path that fades in/out.

Technique: React useState tracks checked state and animation direction. A separate animKey state triggers a component key change to restart the CSS animation. Two @keyframes (cb-bounce-in, cb-bounce-out) injected once via useEffect. The animation property on the box references the correct keyframe by name.

Accessibility: Hidden native <input type="checkbox">. Animations skipped under prefers-reduced-motion.

My stack: {{USER_STACK}}
My styling: {{USER_STYLING}}
My constraints: {{USER_CONSTRAINTS}}

Return a single self-contained component. Do not introduce dependencies beyond what I've listed.

Paste into Claude, ChatGPT, or Cursor. Edit YOUR_STACK / YOUR_STYLING / YOUR_CONSTRAINTS before sending.

Vybe Sync

Tools

  • Contrast Checker
  • Design Spy

Resources

  • Chrome Extension
  • Figma Plugin

Animations

  • Components
  • Inspiration

Company

  • Blog
  • About Us

© 2026 VybeSync

Terms of UsePrivacy Policy