{"name":"prob-bar","entry":"component","title":"ProbBar","description":"Labelled probability bar that slides in and fills to its value while the number counts up.","category":"Motion","capabilities":["replay","player"],"needsRemotion":true,"registryDependencies":["@jbm/tokens","@jbm/motion-hooks","@jbm/pop"],"install":"npx shadcn@latest add @jbm/prob-bar","installName":"prob-bar","page":"https://jbm-ui.bns.studio/c/prob-bar","registryItem":"https://jbm-ui.bns.studio/r/prob-bar.json","sourcePath":"registry/jbm/motion/prob-bar.tsx","files":[{"source":"registry/jbm/motion/prob-bar.tsx","target":"src/jbm/motion/prob-bar.tsx","import":"@/jbm/motion/prob-bar","type":"registry:component"}],"endpoints":{"markdown":"https://jbm-ui.bns.studio/catalog/prob-bar.md","json":"https://jbm-ui.bns.studio/catalog/prob-bar.json"},"snippet":"import { ProbBar } from \"@/jbm/motion/prob-bar\"\n\n<ProbBar label=\"Confianza\" p={0.86} at={0.2} />","api":[{"export":"ProbBar","kind":"component","summary":"One row: a 24px mono label, a rounded track whose vermilion fill eases to `p` over 0.7 s, and the live value to two decimals. The row pops in from the left by 12px at `at`.","props":[{"name":"label","type":"string","required":true,"default":null,"description":"Mono label on the left, in ink."},{"name":"p","type":"number","required":true,"default":null,"description":"Target probability, 0–1; the fill ends at p × track width and the value reads p to two decimals. Not clamped: values above 1 overflow the track and are clipped."},{"name":"at","type":"number","required":true,"default":null,"description":"Start of the entrance and fill in seconds relative to the enclosing Sequence."},{"name":"w","type":"number","required":false,"default":"520","description":"Row width budget in stage pixels; the track is w − labelW − 90 wide."},{"name":"labelW","type":"number","required":false,"default":"230","description":"Width reserved for the label in stage pixels; long labels wrap inside it."}],"passthrough":[]}],"stage":{"mode":"declared","landscape":{"width":546,"height":29},"vertical":{"width":546,"height":29},"basis":"Label (labelW 230) + 18 gap + track (w − labelW − 90 = 200) + 18 gap + 80px value gives w + 26 = 546 at w 520. Height is one line of 24px mono text (about 29px at normal line-height; the track itself is 22px). A label that wraps in labelW adds lines. The wrapper is a block element, so it stretches to its container's width while the row content stays w + 26."},"examples":[{"title":"One probability","code":"import { ProbBar } from \"@/jbm/motion/prob-bar\"\n\n<ProbBar label=\"Confianza\" p={0.86} at={0.2} />"},{"title":"A ranked list","code":"import { ProbBar } from \"@/jbm/motion/prob-bar\"\n\n{[[\"gato\", 0.72], [\"perro\", 0.21], [\"zorro\", 0.07]].map(([label, p], i) => (\n  <ProbBar key={label} label={String(label)} p={Number(p)} at={0.4 + i * 0.3} w={720} />\n))}"}],"qa":["Step to the first frame (row hidden, value 0.00), mid-fill (partial bar, intermediate value), and the last frame (bar at p, value exactly p to two decimals).","Check p = 0 and p = 1: an empty track still reads, and a full fill stays inside the rounded track.","Try a long label: confirm it wraps within labelW and does not push the track; the exact row height at normal line-height is approximate (about 29px) and should be measured if layout depends on it."],"related":[{"name":"tokens","relation":"installs"},{"name":"motion-hooks","relation":"installs"},{"name":"pop","relation":"installs"}],"galleryPreview":{"about":"Cue times are seconds on the gallery preview's timeline, which renders the demo below; the Usage examples may use other timings. Map a cue to your own props by its place in the demo.","fps":30,"durationInFrames":28,"lastFrame":27,"strip":"https://jbm-ui.bns.studio/c/prob-bar?view=strip","frames":[{"label":"Empty stage","frame":0,"at":0},{"label":"Bar filling","frame":12,"at":0.4,"note":"The bar is part-way to 0.86 and the value readout matches its length."},{"label":"End","frame":27,"at":0.9}],"demo":[{"component":"ProbBar","props":{"label":"Confianza","p":0.86,"at":0.2,"w":620}}],"code":"<ProbBar label=\"Confianza\" p={0.86} at={0.2} w={620} />"},"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"}}