Spray

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/button-spray

About this component

A matte black spray can lying on its side, the label on its lime band under a magenta drip print. Hover and it gets two quick shakes; press and a cone of magenta mist leaves the nozzle and lands on the wall behind it, and moving the pointer while you hold swings the cone. Heavy paint runs into drips that slide down behind the can, and the wall fades clean a moment after you let go.

Triggers

  • Hover
  • Click
  • Mouse tracking

Techniques

  • SVG
  • requestAnimationFrame
  • Event position

Difficulty

Advanced

Accessibility

Keyboard and screen readers

A native <button> named by its label, Paint it; the can art and both canvases are aria-hidden. Holding Enter or Space sprays at the default angle and releasing stops.

Reduced motion

There is no shake or buzz, droplets land straight away and no drips run.

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

More buttons

See all
CounterGet code
SealGet code
BubbleGet code
SapphireGet code