Magnets

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/input-magnets

About this component

A note field on a glossy mint fridge door with a chrome handle. Each letter you type snaps on from above as a plastic fridge magnet, at its own tilt, in red, yellow, blue, green, orange or purple.

Triggers

  • Focus
  • Spring
  • State change

Techniques

  • Keyframes
  • CSS variables
  • Text animation

Difficulty

Advanced

Accessibility

Keyboard and screen readers

A native text input named by aria-label ("Note"); the door, handle, magnets and caret are aria-hidden. Focus draws a green ring round the door.

Reduced motion

Letters appear in place and the caret stays solid.

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

More inputs

See all
MalachiteGet code
PapercutGet code
PoolGet code
SpectrumGet code