{"name":"stat-card","entry":"component","title":"StatCard","description":"One number with its context on a raised Card: mono label, large value, and a short sub line, stacked or in a row.","category":"UI","capabilities":[],"needsRemotion":false,"registryDependencies":["@jbm/tokens","@jbm/card"],"install":"npx shadcn@latest add @jbm/stat-card","installName":"stat-card","page":"https://jbm-ui.bns.studio/c/stat-card","registryItem":"https://jbm-ui.bns.studio/r/stat-card.json","sourcePath":"registry/jbm/ui/stat-card.tsx","files":[{"source":"registry/jbm/ui/stat-card.tsx","target":"src/jbm/ui/stat-card.tsx","import":"@/jbm/ui/stat-card","type":"registry:ui"}],"endpoints":{"markdown":"https://jbm-ui.bns.studio/catalog/stat-card.md","json":"https://jbm-ui.bns.studio/catalog/stat-card.json"},"snippet":"import { StatCard } from \"@/jbm/ui/stat-card\"\n\n<StatCard label=\"Contexto\" value=\"1M\" sub=\"tokens\" w={620} h={245} />\n<StatCard row label=\"Latencia\" value=\"0.8s\" sub=\"p50\" w={620} h={140} />","api":[{"export":"StatCard","kind":"component","summary":"Fixed-size Card (border-box) holding a mono label, an 800-weight value, and an optional sub line. Stacked by default for landscape; `row` puts the value (fixed 400px column) beside the label and sub for vertical stages.","props":[{"name":"label","type":"string","required":true,"default":null,"description":"Mono caption naming the number, 22px in the dim color."},{"name":"value","type":"React.ReactNode","required":true,"default":null,"description":"The number or short value; 96px stacked, 84px in row mode, -3px tracking."},{"name":"sub","type":"string","required":false,"default":null,"description":"Optional one-line context under the label (row) or under the value (stacked); dim when stacked, ink in row mode."},{"name":"valueColor","type":"string","required":false,"default":"color.accent","description":"Value color; defaults to the vermilion accent. Use color.ink when another element already carries the accent."},{"name":"w","type":"number","required":false,"default":"520","description":"Card width in stage pixels, including padding and border."},{"name":"h","type":"number","required":false,"default":"300","description":"Card height in stage pixels, including padding and border."},{"name":"row","type":"boolean","required":false,"default":"false","description":"Lays value, then label and sub, side by side with 22×34px padding and a 30px gap; the scene compiler uses it for vertical stages."},{"name":"style","type":"React.CSSProperties","required":false,"default":null,"description":"Inline styles merged after the size and row layout."}],"passthrough":[]}],"stage":{"mode":"declared","landscape":{"width":520,"height":300},"vertical":{"width":520,"height":300},"basis":"Card is border-box, so the defaults w=520 and h=300 are the outer size in either orientation. For vertical stages SceneFromSpec renders `row` cards at the full content width (936) and h=180, and the gallery shows w=620 with h=245 stacked and h=140 in a row."},"examples":[{"title":"Stacked and row cards","code":"import { StatCard } from \"@/jbm/ui/stat-card\"\n\n<StatCard label=\"Contexto\" value=\"1M\" sub=\"tokens\" w={620} h={245} />\n<StatCard row label=\"Latencia\" value=\"0.8s\" sub=\"p50\" w={620} h={140} />"},{"title":"Ink value beside another accent","code":"import { StatCard } from \"@/jbm/ui/stat-card\"\nimport { color } from \"@/jbm/lib/tokens\"\n\n<StatCard label=\"Precisión\" value=\"86%\" valueColor={color.ink} />"}],"qa":["Content does not fit itself: check the widest value and longest sub stay inside w×h in both layouts, since the card has a fixed height and does not clip or shrink text.","In row mode the value column is a fixed 400px; with w below about 500 the label and sub have almost no room.","Compare stacked landscape and row vertical cards on cream: fine border, layered shadow, and inset highlight come from Card."],"related":[{"name":"tokens","relation":"installs"},{"name":"card","relation":"installs"},{"name":"scene-spec","relation":"installed-by"}],"setup":{"namespace":"@jbm","componentsJson":{"registries":{"@jbm":"https://jbm-ui.bns.studio/r/{name}.json"}},"command":"npx shadcn@latest add @jbm/<name>","target":"src/jbm/","importAlias":"@/jbm/…","tsconfigPaths":{"@/*":["./src/*"]}},"rules":["Install through the @jbm namespace: each registry item JSON (/r/<name>.json) carries its files' contents and each guide is served at /docs/<slug>.md, so agents never need the source repository (it is public on GitHub for people browsing the code).","Files install to src/jbm/ and import as @/jbm/…, which needs the @/* → ./src/* path alias in tsconfig.json.","Items marked needsRemotion require the remotion package and must render inside a Remotion composition or Player; every other item works in any React page.","Use one vermilion accent per composition; accent2 is for annotations only and soft is for dark surfaces only.","Stages are 1920×1080 landscape and 1080×1920 vertical with declared safe areas; each item's stage field declares its size in stage pixels, and scenes compose from YAML-shaped specs with @jbm/scene-spec."],"links":{"catalog":"https://jbm-ui.bns.studio/catalog.json","llms":"https://jbm-ui.bns.studio/llms.txt"}}