Piñata
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/button-pinataAbout this component
A party piñata hanging on its cord: five rows of crepe-paper fringe in pink, orange, yellow, teal and violet, with the label on a paper tag. Hover swings it away from your pointer and the fringe rustles row by row; a press whacks it, it jolts on the cord and wrapped sweets, lollies and torn fringe drop out and bounce on the floor.
Triggers
- Hover
- Click
- Spring
- Delay stagger
Techniques
- SVG
- requestAnimationFrame
- Stagger
- Event position
Difficulty
Advanced
Accessibility
Keyboard and screen readers
A native <button> named by its tag label, Celebrate; the cord, fringe and canvas are aria-hidden. Keyboard focus outlines the tag and Enter or Space whacks it.
Reduced motion
The swing, rustle and sweets are skipped.
Use it in anything you build, commercial and client work included. Licence