Mousetrap
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/button-mousetrapAbout this component
A wooden mousetrap with the label on the plank and cheese on the pedal: hover and the cheese trembles, press and the pedal tips, the bar snaps round and slams with a shake of the board, then it is slowly set again.
- Dependencies
- None
- Difficulty
- Advanced
- Reduced motion
- Respected
- Theme
- Light and dark
- Follows page color-scheme
Triggers3
- Click
- Hover
- State change
Techniques4
- 3D transform
- Keyframes
- CSS transition
- SVG
Accessibility
Keyboard and screen readers
A native button named "Take the bait", renamed while it is sprung; everything drawn is aria-hidden.
Reduced motion
The bar snaps and resets without animation.
Use it in anything you build, commercial and client work included. Licence