{"name":"scroll-text-fill","entry":"component","title":"ScrollTextFill","description":"Scroll to bring text into focus, one character at a time. Keyboard scrolling, reversible progress, and reduced-motion support.","category":"Interactive","capabilities":["scroll"],"needsRemotion":false,"registryDependencies":["@jbm/text-fill","@jbm/tokens"],"install":"npx shadcn@latest add @jbm/scroll-text-fill","installName":"scroll-text-fill","page":"https://jbm-ui.bns.studio/c/scroll-text-fill","registryItem":"https://jbm-ui.bns.studio/r/scroll-text-fill.json","sourcePath":"registry/jbm/ui/scroll-text-fill.tsx","files":[{"source":"registry/jbm/ui/scroll-text-fill.tsx","target":"src/jbm/ui/scroll-text-fill.tsx","import":"@/jbm/ui/scroll-text-fill","type":"registry:ui"}],"endpoints":{"markdown":"https://jbm-ui.bns.studio/catalog/scroll-text-fill.md","json":"https://jbm-ui.bns.studio/catalog/scroll-text-fill.json"},"snippet":"import { ScrollTextFill } from \"@/jbm/ui/scroll-text-fill\"\n\n<ScrollTextFill\n  text=\"Una idea toma forma. Letra por letra.\"\n  height={320}\n  distance={640}\n  style={{ fontSize: 40 }}\n/>\n// Self-contained scroll region; respects prefers-reduced-motion.","api":[{"export":"ScrollTextFill","kind":"component","summary":"Self-contained, focusable scroll region that pins a TextFill in a sticky row and maps its own scroll position (0 at top, 1 at the bottom) to fill progress. Scrolling back rewinds; it never autoplays. Under reduced motion it renders the full text statically with no scroll region.","props":[{"name":"className","type":"string","required":false,"default":null,"description":"Class name on the TextFill span."},{"name":"style","type":"CSSProperties","required":false,"default":null,"description":"Inline styles for the TextFill span; set fontSize here."},{"name":"text","type":"string","required":true,"default":null,"description":"The sentence to fill; passed to TextFill."},{"name":"dimColor","type":"string","required":false,"default":null,"description":"Color of characters not yet reached; passed to TextFill."},{"name":"accentColor","type":"string","required":false,"default":null,"description":"Color of the leading wave; passed to TextFill."},{"name":"textColor","type":"string","required":false,"default":null,"description":"Final color of settled characters; passed to TextFill."},{"name":"reducedMotion","type":"boolean","required":false,"default":null,"description":"Overrides the system prefers-reduced-motion setting. True renders the complete text with auto height and no scrolling; undefined follows the system preference (and renders reduced on the server)."},{"name":"height","type":"number","required":false,"default":"320","description":"Height of the scroll viewport in stage pixels. Minimum 120; non-finite values fall back to 320."},{"name":"distance","type":"number","required":false,"default":"640","description":"Extra scroll distance in pixels beyond the viewport; the whole fill happens over this travel. Minimum 1; non-finite values fall back to 640."},{"name":"label","type":"string","required":false,"default":"\"Scroll to fill the text\"","description":"Accessible name of the scroll region."}],"passthrough":["Omit<TextFillProps, \"progress\">"]}],"stage":{"mode":"declared","landscape":{"width":"fill","height":320},"vertical":{"width":"fill","height":320},"basis":"The region is width 100% and exactly `height` (default 320, minimum 120) stage pixels tall; the scrollable content inside is height + distance. With reduced motion the height becomes auto: the text plus 24px padding on each side, with a minimum of `height`."},"examples":[{"title":"Contained scroll fill","code":"import { ScrollTextFill } from \"@/jbm/ui/scroll-text-fill\"\n\n<ScrollTextFill\n  text=\"Una idea toma forma. Letra por letra.\"\n  height={320}\n  distance={640}\n  style={{ fontSize: 40 }}\n/>\n// Self-contained scroll region; respects prefers-reduced-motion."}],"qa":["Scroll the region from top to bottom and back: fill tracks scroll position in both directions and is complete exactly at the bottom.","Focus the region with Tab and use ↓ / ↑ (and Page Down / Up): it scrolls and fills without scrolling the page (overscroll is contained).","Enable prefers-reduced-motion (or pass reducedMotion): the full ink text renders statically, the region is not focusable, and there is no scroll.","Check narrow screens: long text wraps inside the sticky row and stays vertically centered in the viewport.","Change text or height after mount and confirm progress recomputes (a ResizeObserver re-measures)."],"related":[{"name":"text-fill","relation":"installs"},{"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"}}