Mano
Position and rotate the independent Hand illustration with controlled coordinates.
Install
npx shadcn@latest add @jbm/manoNeeds the @jbm entry in components.json; see Install once.
Also installs @jbm/tokens, @jbm/hand, @jbm/scene-geometry.
Usage
import { Mano } from "@/jbm/motion/mano"<svg viewBox="0 0 500 340"> <Mano at={{ x: 160, y: 30 }} pose="point" size={155} angle={12} /></svg>import { Mano, pointOn, pathTilt } from "@/jbm/motion/mano"const path = [{ x: 40, y: 200 }, { x: 240, y: 60 }, { x: 440, y: 160 }]const progress = 0.4 // from a slider or useProgress<svg viewBox="0 0 500 340"> <Mano at={pointOn(path, progress)} angle={pathTilt(path, progress)} pose="pinch" size={120} anchor={{ x: 15, y: 14 }} /></svg>Props
- Stage px
- Declared at the documented defaults
- Landscape
180 by 264- Vertical
180 by 264- Basis
Parent SVG user units at size 180 without anchor: a 180 × 264 box (size × 44/30) from at, with the 180 × 174 hand centred in it (about 45 units of empty space above and below). With anchor the box is size × 29/30 tall and offset so the anchor lands on at. angle rotates the box about at.
SVG <g> that places the Hand illustration at a point, scales it, and rotates it about that point. Hand owns the artwork and pose; callers own movement (e.g. pointOn and pathTilt along a path). No internal timer. Render inside an <svg>.
| Prop | Type | Default | Description |
|---|---|---|---|
at | Pt | required | Point in the parent SVG's user units: the Hand box's top-left corner, or where the anchor point sits when anchor is set. Rotation pivots here. |
pose | HandPose | "point" | Hand pose: open, point, pinch, grip, type, or hold (see Hand). |
size | number | 180 | Hand width in parent SVG units. Without anchor the box is size × 44/30 tall (264 at 180) with the 30×29 art centred vertically; with anchor it is size × 29/30 tall. |
angle | number | 0 | Rotation in degrees about at; positive is clockwise. |
anchor | Pt | none | Local point in the Hand's 30×29 viewBox held at at, including during rotation. |
halo | boolean | none | Pass Hand's card knock-out ring through, for ink art drawn behind the hand. Default false. |
QA checks
- Switch pose through all seven at the same at: the hand stays in its box and does not jump unexpectedly.
- Drag Rotation from −30 to 30: the hand pivots about at (or the anchor point), not its centre.
- Drag Position through Left, Center, and Right: the hand crosses the stage from its left margin to its right margin without resizing, and stays inside the viewBox at every rotation from −30° to 30°.
- Anchor coordinates are in the 30×29 viewBox but each pose applies its own internal transform, so the fingertip lands at a different local point per pose; check the anchor visually for each pose you use.