{"name":"counter","entry":"component","title":"Counter","description":"Number that counts up to a target.","category":"Motion","capabilities":["replay","player"],"needsRemotion":true,"registryDependencies":["@jbm/big","@jbm/motion-hooks"],"install":"npx shadcn@latest add @jbm/counter","installName":"counter","page":"https://jbm-ui.bns.studio/c/counter","registryItem":"https://jbm-ui.bns.studio/r/counter.json","sourcePath":"registry/jbm/motion/counter.tsx","files":[{"source":"registry/jbm/motion/counter.tsx","target":"src/jbm/motion/counter.tsx","import":"@/jbm/motion/counter","type":"registry:component"}],"endpoints":{"markdown":"https://jbm-ui.bns.studio/catalog/counter.md","json":"https://jbm-ui.bns.studio/catalog/counter.json"},"snippet":"import { Counter } from \"@/jbm/motion/counter\"\n\n<Counter n={1024} at={0.2} dur={1.5} />","api":[{"export":"Counter","kind":"component","summary":"Renders a Big numeral that eases from 0 to `n`, rounded to whole numbers, on the Remotion timeline.","props":[{"name":"n","type":"number","required":true,"default":null,"description":"Target value; the count ends here and holds."},{"name":"at","type":"number","required":true,"default":null,"description":"Start time in seconds from the start of the sequence."},{"name":"dur","type":"number","required":false,"default":"0.8","description":"Seconds the count takes to reach `n`."},{"name":"size","type":"number","required":false,"default":"140","description":"Font size in stage pixels, passed to Big."},{"name":"color","type":"string","required":false,"default":"color.accent","description":"Text color; keep the one vermilion accent per composition."}],"passthrough":[]}],"stage":{"mode":"declared","landscape":{"width":"auto","height":147},"vertical":{"width":"auto","height":147},"basis":"One line of Big at size 140 with line-height 1.05. Height is size × 1.05; width follows the digit count of `n` (about 0.6 × size per digit)."},"examples":[{"title":"Count to a key number","code":"import { Counter } from \"@/jbm/motion/counter\"\n\n<Counter n={1024} at={0.2} dur={1.5} />"},{"title":"Smaller, in ink, beside other text","code":"import { Counter } from \"@/jbm/motion/counter\"\nimport { color } from \"@/jbm/lib/tokens\"\n\n<Counter n={42} at={1} size={96} color={color.ink} />\n// Render inside a Remotion <Composition> or <Player>."}],"qa":["Step to the first, middle, and last frames: 0 before `at`, an intermediate whole number mid-count, and exactly `n` at rest.","In a host composition, check the widest value of `n` stays inside the safe area at the chosen size in both orientations (the gallery bench previews landscape only).","Confirm only one element on the stage uses the accent color."],"related":[{"name":"big","relation":"installs"},{"name":"motion-hooks","relation":"installs"},{"name":"tokens","relation":"example-import"}],"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":52,"lastFrame":51,"strip":"https://jbm-ui.bns.studio/c/counter?view=strip","frames":[{"label":"Begin","frame":0,"at":0},{"label":"Counting up","frame":15,"at":0.5,"note":"The number is mid-count (about halfway), easing toward 1024."},{"label":"End","frame":51,"at":1.7}],"demo":[{"component":"Counter","props":{"n":1024,"at":0.2,"dur":1.5}}],"code":"<Counter n={1024} at={0.2} dur={1.5} />"},"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"}}