Elastic Press

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/button-elastic-press

About this component

On click, a CSS keyframe animation fires, squishing the button horizontally then snapping back with an overshoot oscillation that simulates spring physics. The animation is re-triggered cleanly on every click by removing and re-adding the data attribute with a forced reflow. No dependencies.

Triggers

  • Click

Techniques

  • Keyframes
  • Transform only

Difficulty

Beginner

Accessibility

Reduced motion

Only a simple scale(0.96) is shown without oscillation.

Use it in anything you build, commercial and client work included. Licence

More buttons

See all
GlitchGet code
Gradient BorderGet code