jbmui

Hand

  • UI Bits
  • adjustable

Static line-art hand in open-palm, pointing, pinching, gripping, typing, holding, or writing pose, independent of placement and props.

Install

npx shadcn@latest add @jbm/hand

Needs the @jbm entry in components.json; see Install once.

Also installs @jbm/tokens.

Docs

Usage

Pinching hand
import { Hand } from "@/jbm/ui/hand"<Hand pose="pinch" width={160} />
Writing hand, holding a pen
import { Hand } from "@/jbm/ui/hand"import { Pluma } from "@/jbm/motion/pluma" // install @jbm/pluma separately// write is drawn for a pen: on its own it holds nothing.<Hand pose="write" width={120} />// Pluma draws it with the pen, at the film's writing tilt.<svg viewBox="0 0 500 340">  <Pluma at={{ x: 220, y: 150 }} size={180} angle={30} pose="write" /></svg>
The four reader poses
import { Hand } from "@/jbm/ui/hand"<Hand pose="point" width={120} /><Hand pose="type" width={120} /><Hand pose="grip" width={120} /><Hand pose="hold" width={120} />
Hold a side-view mug
import { Hand } from "@/jbm/ui/hand"import { DeskProp } from "@/jbm/ui/desk-prop" // install @jbm/desk-prop separately// A 180-wide hand: the mug's rim (deskPropLayout(...).rim) sits at 93 48.4, just under the thumb.<svg viewBox="0 0 222 174">  <DeskProp kind="mug-side" x={157} y={98} scale={1.6} />  <Hand pose="hold" width={180} height={174} style={{ height: 174 }} /></svg>
Place and rotate inside an SVG
import { Hand } from "@/jbm/ui/hand"import { Mano } from "@/jbm/motion/mano" // install @jbm/mano separately<Hand pose="open" width={120} /><svg viewBox="0 0 500 340">  <Mano at={{ x: 160, y: 30 }} pose="point" angle={12} /></svg>

API

Stage px
Declared at the documented defaults
Landscape
180 by 174
Vertical
180 by 174
Basis

The 30×29 viewBox renders at width 180; height is auto from the aspect ratio (180 × 29/30 = 174). Pass width (the gallery uses 155) or style.width to scale; maxWidth is 100% of the container. Every pose shares the box and the wrist sits at its lower edge.

Handcomponent

Card-filled, ink-outlined hand drawn in a 30×29 viewBox. The pose swaps the silhouette only; it owns no position, rotation, folder, pen, or timeline (use Mano from @jbm/mano for placement inside an SVG, Pluma from @jbm/pluma for a held pen). Other SVG attributes pass through to the root <svg>.

PropTypeDefaultDescription
poseHandPose"point"Silhouette: open (open palm, fingers together), point (index finger extended), pinch (index bent over the thumb; Pluma's default pen grip), grip (front-view fist: four fingers with knuckle bumps on top and the curled fingertips in a row beneath, the thumb lying across under them, pointing in; lay the knuckles over a sheet or tab edge), type (the hand from above on a keyboard with the fingers curled down onto the keys: four short stubs, the middle tallest, whose caps are the bent middle joints with the fingertips out of sight beneath (no marks across them), and the thumb low, pointing left toward the space bar; at thumbnail size it reads as the open palm with its fingers folded), or hold (upright, seen from the side: the palm rises straight from the wrist and its top sweeps up into a finger-width thumb that bends at a rounded joint and lies over the held object's rim, tip toward the fingers, with a short crease where it leaves the palm; the four fingers lie stacked on the right, wrapped round the object's side with their tips facing the palm, and the open pocket between palm, thumb, fingertips, and heel is where the object sits; draw a side-view mug or a sheet's corner behind it, the rim or top edge just under the thumb; the pose is drawn for an object, and on its own the stacked fingers read apart from the palm, so show it round one), or write (a right hand holding a pen in a tripod grip, traced from an owner-approved Quiver Arrow reference (Paper page hands, artboard Hands v7 · write (Quiver Arrow)) in its own frame at the shared outline weight: seen from the back and a little above, fingers toward the nib, the index lying along the barrel to its round tip near the nib, the thumb's round tip closing on the barrel just behind it in a round notch, the middle fingertip under the thumb, three curled knuckles down the right side with short dividers, the thumb's top edge running into the web as a crease, and a short wrist; turned so a held pen slants as pinch's does; drawn for a pen, so show it with Pluma pose write). Every pose draws its dividers from the outline's valley points in the outline's stroke width; grip, type, hold, and write draw all their ink as one path (interior lines retraced as spurs), so joins are tangent with no steps, and the valleys between fingertips and grip's palm edge between index and thumb round off in small fillets. The palm side meets the wrist cut in one tangent-continuous fillet. Also sets the accessible label, e.g. "Hand: point".
halobooleanfalseKnock the hand out of what it overlaps: a card ring half the outline wide just outside the contour, so ink art passing behind the hand (a pen barrel, a thread) never fuses with its outline. The ring paints over everything under the hand, writing included; to cut only the art behind the hand, mask that art with handOutline instead (Pluma does). Default false.

Also accepts SVGProps<SVGSVGElement>.

handOutlinefunction

A pose's closed outline in the Hand's 30×29 viewBox (for grip, type, hold, and write it also retraces the interior lines inside it, which add no area), for composites that cut art drawn behind the hand (a mask or clip path) instead of painting a halo over whatever else is under it. Place it with the same transforms as the Hand (Mano's translate, rotate, and anchor, then a scale of size / 30). For write it also names the parts that lie in front of a held pen (the thumb and index finger), so a pen drawn over the hand can stop at them.

ParamTypeDefaultDescription
poseHandPose"point"Hand pose; defaults to point, like Hand.

Returns { d, transform, strokeWidth, front }: the outline path, the transform that places it in the viewBox, the outline's stroke width in path units, and (write only; otherwise undefined) front, the regions in front of a held pen as closed subpaths in the same units and transform, each bounded where it crosses the pen by the hand's own ink. Stroke a path at twice the width to cover the outline plus a gap half the outline wide.

handPosesconstant

Every pose name in gallery order: open, point, pinch, grip, type, hold, write. HandPose is its element type.

QA checks

  • Switch Pose through all seven: each silhouette sits in the same box with the wrist at the bottom and keeps simple geometric line art and the same outline weight.
  • Enlarge every pose (point and pinch included) and inspect the finger joins: each interior divider starts on the outline's valley point, continues the finger's side, and has the outline's stroke width, with no notch or step, and grip, type, and hold keep the open palm's wrist cut exactly (grip and type also its right side); write closes along its own straight wrist cut. At 8×, grip, type, hold, and write show no step where a finger side meets a knuckle or fingertip arc, no sharp cusp between fingertips, and no hook at the wrist.
  • Name each pose at gallery size and compare it with its generated reference (Paper page hands, artboard Hands v5 for type and hold): grip reads as a fist gripping an edge (knuckles on top, fingertips in a row, thumb across beneath, pointing in), type as a hand from above with its fingers curled down onto keys (short stubs with no marks across them, thumb low toward the space bar), hold as an upright hand round an object (a finger-width thumb over the rim, no bigger than a finger and never a hook arching over the top; stacked fingers on the far side; an open pocket between; a palm no wider than the finger stack is tall).
  • Render all seven at 48px side by side: a stranger tells every pose apart, type from open above all (short folded fingers against tall straight ones), and the thumb and index tips never touch in pinch or hold (in write they meet by design, on the pen).
  • Overlay write on its reference (tools/blender/hand/reference/write.quiver.svg; out/write.trace.svg from tools/blender/hand/trace/write.py): the path runs on the reference's line centres everywhere the pen doesn't hide it, and every contour, stroke included, stays inside the box; the six other poses render exactly as before write was redrawn.
  • In context, grip over a Paper sheet's top edge, type over a DeskProp keyboard (fingertips on the upper rows, thumb over the space bar), and hold upright over a side-view mug (DeskProp kind mug-side: body in the pocket, rim just under the thumb) and over a sheet's top corner.
  • Check the card fill and ink stroke read on cream, and the aria-label follows the pose.
  • Scale with width at narrow screens: the 30:29 aspect ratio holds.