Magnets
Markup where the component goes, CSS in your stylesheet, script before </body>. In Vue, Svelte or Angular, call initFieldMagnets(el) on the mounted element instead.
Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/input-magnetsAbout 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