Putty

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/button-putty

About this component

A slab of putty whose outline is a live shape on a spring: press and the top caves in under your finger (drag to move the dent), the sides bulge and the base spreads as a squeezed lump keeps its volume, the label squashing with it; let go and it springs back past flat and wobbles until it settles.

Dependencies
None
Difficulty
Intermediate
Reduced motion
Respected
Theme
Light and dark
Follows page color-scheme

Triggers2

  • Click
  • Mouse tracking

Techniques4

  • SVG
  • Spring
  • requestAnimationFrame
  • Event position

Accessibility

Keyboard and screen readers

A native button named by its label, Squish; the dents are aria-hidden.

Reduced motion

The slab does not squash and the dents vanish without easing.

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

More buttons

See all
RisoGet code
SaloonGet code
SnoozeGet code
SnowcapGet code