@zgeoff/storyboard
v0.2.6
Published
Build the animated SVG images at the top of a README from one JSX scene, and check them
Readme
Build the animated SVG at the top of a README from one JSX scene, and check it.
You write a scene as JSX: terminals, lines, statuses and flights, grouped into stages.
storyboard build places each change on a half-second grid, checks the timing rules, and writes a
dark and a light SVG from one render. The files use SMIL, so they animate where a README shows them,
with no script.
Install
bun add -d @zgeoff/storyboard @zgeoff/rig
bunx storyboard new hero
bun run storyboardstoryboard new <scene> writes the scene under scripts/storyboard/<scene>/, and when the repo has
no scene yet it also writes the two check suites and a storyboard script. @zgeoff/rig is an
optional peer dependency that only the browser suite imports.
Features
- A JSX runtime (
@zgeoff/storyboard/jsx-runtime) that builds a tree, so a scene needs no React. - A timeline that fails the build, naming the change, when a timing rule breaks. How storyboard works gives the rules.
- Terminals, lines, typed prompts, statuses, alerts, flights, pulses, cursors and stamps, and
defineHostanddefineEffectfor parts of your own. - Output that is byte-stable: a second build writes the same bytes, and nothing is written when a scene fails.
@zgeoff/storyboard/checks: a unit suite that checks each committed file against an allow-list, its size, and whether it is stale.@zgeoff/storyboard/browser: a browser suite that steps each file through its frames in Chrome and fails on overlapping text, text outside the view box, and a loop whose last frame differs from its first.
Documentation
How storyboard works gives the timing rules and the checks, and the docs index lists every doc.
