Weigh
Markup where the component goes, CSS in your stylesheet, script before </body>. In Vue, Svelte or Angular, call initCardWeigh(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/card-weighAbout this component
A weight log card: a ruler whose line bends toward the knob as if the knob were a magnet, the ticks leaning with it, and a yellow light pooled round the knob. Drag the knob or use the arrow keys and the big reading rolls, the bend following the knob up and down the scale. Switch lb to kg and the ruler re-marks itself while the figure converts; Save stamps the entry with a tick.
Triggers
- Card
- Glow
- Mouse tracking
- State change
- Click
- Draw
Techniques
- SVG
- CSS variables
- Event position
- CSS transition
- Radial gradient
Difficulty
Advanced
Accessibility
Keyboard and screen readers
The ruler is a role='slider' labelled Weight with aria-valuenow in pounds and an aria-valuetext in the chosen unit; arrow keys step 1, Page keys 5, Home and End jump; the unit keys expose aria-pressed and Save's label becomes Saved.
Reduced motion
Reduced motion removes the thumb and button transitions; the bend itself is drawn per value and needs none.
Use it in anything you build, commercial and client work included. Licence
More cards
See allDesign review
LiveMira Holt
Art director
Field recordings
412files