{"name":"replay-button","entry":"component","title":"ReplayButton","description":"Controlled replay icon whose arrow charges from tail to arrowhead as the host animation progresses, then unlocks.","category":"Interactive","capabilities":["replay"],"needsRemotion":false,"registryDependencies":["@jbm/tokens"],"install":"npx shadcn@latest add @jbm/replay-button","installName":"replay-button","page":"https://jbm-ui.bns.studio/c/replay-button","registryItem":"https://jbm-ui.bns.studio/r/replay-button.json","sourcePath":"registry/jbm/ui/replay-button.tsx","files":[{"source":"registry/jbm/ui/replay-button.tsx","target":"src/jbm/ui/replay-button.tsx","import":"@/jbm/ui/replay-button","type":"registry:ui"}],"endpoints":{"markdown":"https://jbm-ui.bns.studio/catalog/replay-button.md","json":"https://jbm-ui.bns.studio/catalog/replay-button.json"},"snippet":"import { ReplayButton } from \"@/jbm/ui/replay-button\"\n\n<ReplayButton\n  progress={progress} // 0–1 from your animation\n  charging={isPlaying}\n  onReplay={restartAnimation}\n  label=\"Replay animation\"\n/>","api":[{"export":"ReplayButton","kind":"component","summary":"Ink replay button with a 44px minimum hit area. While `charging`, the circular shaft draws on over the first 85% of `progress` and the arrowhead over the last 15%; clicks are ignored and the button stays focusable with aria-disabled. When not charging it shows the complete icon and calls `onReplay` on click. No internal timer and no Remotion dependency.","props":[{"name":"progress","type":"number","required":true,"default":null,"description":"Normalized progress of the host animation, 0–1. Clamped; non-finite values count as 0. Ignored (treated as 1) when `charging` is false."},{"name":"charging","type":"boolean","required":true,"default":null,"description":"True while the host animation plays: shows the partial charge and blocks activation (aria-disabled, still focusable). False shows the complete icon and allows replay."},{"name":"onReplay","type":"() => void","required":true,"default":null,"description":"Called on click only when neither `charging` nor `disabled` is set; restart your animation here."},{"name":"label","type":"string","required":false,"default":"\"Replay animation\"","description":"Accessible name (aria-label) for the button."},{"name":"iconSize","type":"number","required":false,"default":"26","description":"Width and height of the icon in pixels; the button adds 9px padding on each side."}],"passthrough":["Omit< React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\" | \"onClick\" | \"type\" | \"aria-label\" >"]}],"stage":{"mode":"declared","landscape":{"width":44,"height":44},"vertical":{"width":44,"height":44},"basis":"iconSize 26 plus 9px padding on each side gives 44×44, which is also the enforced minimum hit area. Size grows with iconSize (iconSize + 18); the gallery demo uses iconSize 52 for a 70×70 button."},"examples":[{"title":"Wire to any animation","code":"import { ReplayButton } from \"@/jbm/ui/replay-button\"\n\n<ReplayButton\n  progress={progress} // 0–1 from your animation\n  charging={isPlaying}\n  onReplay={restartAnimation}\n  label=\"Replay animation\"\n/>"},{"title":"Larger icon","code":"import { ReplayButton } from \"@/jbm/ui/replay-button\"\n\n<ReplayButton progress={1} charging={false} onReplay={() => player.seekTo(0)} iconSize={52} />"}],"qa":["Click replay and watch the charge: the shaft draws from its tail to the top-right, then the two arrowhead strokes draw in after 85% progress; at 100% the complete icon returns.","While charging, click and press Enter/Space: nothing restarts, focus stays on the button, and it announces as disabled.","Tab to the button and confirm the visible focus treatment on cream; check the 44×44 hit area at the default iconSize.","Pass progress values below 0, above 1, and NaN while charging: the icon clamps instead of overdrawing or disappearing."],"related":[{"name":"tokens","relation":"installs"}],"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"}}