Toss

Rhea Okafor

Product designer

rhea.design

+44 7700 900 412

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/card-toss

About this component

A business card lying on the desk that you can pick up and throw: it lifts as you grab it, turns around the point you are holding as you drag, and when you let go it slides on with the speed you gave it, spinning down and bouncing off the edges.

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

Triggers3

  • Mouse tracking
  • Spring
  • Card

Techniques4

  • requestAnimationFrame
  • Event position
  • Transform only
  • CSS variables

Accessibility

Keyboard and screen readers

The card is a focusable group with its name and contact details as text; arrow keys slide it across the desk.

Reduced motion

It moves only while you drag it, with no throw or spin.

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

More cards

See all
VolvelleGet code

Gift voucher

Holloway Books

£50

No. 0471 2286

WatermarkGet code
Avebury stones3 lenses

Wiltshire · shot at dawn

WigglegramGet code

The Daily Motion

Easing is back

BroadsheetGet code