Web stories
Available format: turns a storyStoryThe compiled model, Story: one source, which every format reads. into a web story:
full-screen cards in 9:16, read one tap at a time, like the stories of a social network. Every
scene is a card: one idea, a background and, if you want, a call to action. Its name,
webstory, keeps it apart from the story model every format reads.
The syntax, its JSON twin and the player of @recit/ are ready: recit dev, recit build,
recit validate, recit convert and recit i18n check read a story, a Récit site publishes it,
recit export -- writes one picture per card (Commands) and recit render
turns it into a 9:16 film (Commands). A story has no PDF. aspectRatio: or 1:1
makes the same cards a portrait or a square post: the player, the images and the film follow.
A minimal story
launch.md
examples/ holds a complete story in English and French: a title over a picture, a
kicker, a stat block, a list, a quote and a call to action.
Settings
In the front matter, or for every story of a folder in the webstory: section of recit.
(the front matter wins). The same keys, nested, are the settings of the JSON twin.
| Setting | Default | What it does |
|---|---|---|
aspectRatio | 9:16 | 9:16, or the posts 4:5 (1080×1350) and 1:1 (1080×1080) |
autoplay | false | cards advance on their own; the reader taps by default (accessible) |
dur | 5 | seconds per card in autoplay |
loop | false | back to the first card after the last one |
images | none | options of --to images: format, scale, cards, maxBytes |
images. | png | encoding of each card: png, jpeg or webp |
images.scale | 3 | device scale of the 360×640 capture, up to 4 |
images.cards | every card | only these cards, by id |
images. | none | a card heavier than this gives a warning |
images. | none | the output presets the story is made for: exported by default, checked by recit validate |
brand | none | signature (logo, mention, position, inFilm, color), overriding recit.config (preview) |
variants | none | .csv, .json or .yaml table (front matter / twin settings) for {{…}} placeholders |
With variants: and brand:, one story declines across places or partners and stamps its corner
signature on every card (above ::cta) and, with brand., on every shot of its film:
see Variants and signature.
With images. (for example [instagram-), recit export -- captures
each preset into its own folder without --preset, and recit validate warns about a card whose
text or call to action likely falls where the app draws its own buttons. It is an estimate from the
layout of the player; recit dev shows the same margins over the card (the Safe area button, or
the key G). A preset of another ratio than the story's is an error.
cover (front matter only) is the round thumbnail of the story in a rail: a color or an image.
Cards
A card starts with its separator line, --- id=. Keep one idea per card:
recit validate refuses more than 40 words or 5 list items on a card, with its line, and warns past
30 cards or a background heavier than 500 KB.
| Attribute | Meaning |
|---|---|
id | stable id: languages, companions and ?card=<id> find the card by it |
background | a color (#2a1f4f), theme, gradient, pixel:<seed>, an image or a short muted video (.mp4, .webm) |
alt | text alternative of an image or a video background, required for them |
overlay | readability gradient: none (default), top, bottom or full |
dur | seconds on screen in autoplay |
hold | extra seconds after a motion block settles |
type | a motion block (title, statement, stat, list…), its props in a ```yaml block |
accent | accent color of this card alone when played by a motion block, like a scene of a film |
background= draws a seeded pixel texture behind the card: a gen=noise texture (see
the ::pixel directive of the motion format) of the card's ratio, about a third of its cells in the
theme's accent and muted colours, over the card's dark ground. The same seed gives the same texture
everywhere; a number up to 4294967295 or a word (pixel:lorem). It is decorative and needs no
alt. A film or a webtoon made from the story takes its own theme instead.
accent= (scenes. in the JSON twin) replaces the theme accent on that card alone
(highlighted bar, curve, emphasized words; a card without type= ignores accent), and a card
converted from a film (motionToWebstory) keeps its accent:
Markdown
::cta[Label]{href= is the last line of its card: a button at the bottom, reached by the
keyboard, opened by a click or a swipe up. :::notes holds a note that is never shown, the
voice-over of the film.
A story with a bible (cast:) can draw a character the bible describes on a card, as a still figure
(preview, @recit/): ::character{character=, or the first image of one
of its cycles with animation=. See the
deck page for its attributes. A character
with a sprite sheet (::sheet in the bible) shows one still pose with
::sprite{character= (see
Sprite sheets).
A ```pixel fence or a ::pixel{gen= (or gen=noise) directive draws a
pixel image on a card as a still SVG (its first frame), coloured by the theme tokens. A missing or
blank alt is a pixel-alt warning with its line (an error under recit validate --) and
leaves the image decorative. See Pixel for the grid, the legend and the
attributes.
Text cards
:::textcard renders a card of text fitted to the frame: safe margins and a background around the
content of an existing block (statement, title, stat or list), supported in webstory and
motion in v1. A webstory card is compiled to static HTML,
so the card uses the minimum size of its variant and nothing overflows; only a film's textcard
block (and the React <TextCard>) picks, in the browser, the largest size that fits. Text exceeding
the variant's character budget is an error with its line.
textcards.story.md
| Attribute | Values | Default | Meaning |
|---|---|---|---|
variant | quote, title, stat, caption, list | none | Required. Sets the dressed block and expected Markdown shape |
background | theme, gradient | theme | Theme surface or a gradient of the theme colours |
source | string | none | Origin of a literal number; required when variant=stat, never translated |
id | string | none | Stable id of the card across languages |
mark | string, 40 characters at most | none | A watermark (a handle, a site name) in the bottom corner, never translated |
Each variant expects a closed shape: quote is one paragraph and an optional — attribution line;
title is # Heading and an optional subtitle line; stat is # value and its label paragraph
with source="…"; caption is one short paragraph; list is an optional heading and a bullet list
of three to five items. Content outside that shape or an unknown attribute is an error with its line
(examples/).
The player
A tap on the first third goes back, anywhere else goes on; a long press holds the card; a swipe left
or right changes card, a swipe up opens the call to action. The arrows, space (pause) and Escape do
the same at the keyboard. A pause button is always visible (WCAG 2.2.2), the clock stops while the
tab is hidden, and under reduced motion nothing plays by itself. ?card=3 or ?card=list opens a
card.
A card with type=… is played by the block of a film, with the same props: it plays its entrance,
then holds. A film becomes a story by changing format: to format:.
The JSON twin
Every story has a typed JSON twin, kind:, validated by
webstory.json. The settings are in settings, and
each card holds its typed fields; cta is an object.
launch.story.json
recit convert launch. writes it, --to md writes the Markdown back.
Alongside scenes.id, scenes.body (see
Scenes › In the JSON twin), scenes.dur and
scenes.cta (cta.label, cta.href) shown above, settings. and each card in scenes
accept:
| Key | Type / values | Effect |
|---|---|---|
settings. | string or { src, alt? | Round thumbnail of the story in a rail (and poster fallback for amp.html): a CSS color, "theme", "gradient", "pixel: (the square texture), a media path, or an object. |
cover.src | string | Required when settings. is an object. Path, URL, color or keyword of the cover. |
cover.alt | string or Record<string, string> | Optional localized text alternative of an image settings.. |
scenes.type | string (non-empty) | Motion block type playing the card ("title", "statement", "stat", "list"…). |
scenes.props | Record<string, unknown> | Props object of the scenes.type block (parsed from the card's fenced YAML block in Markdown, in place of scenes.body). |
scenes.hold | number (>= 0) | Extra seconds held after a motion block settles (hold= in Markdown). |
scenes. | string | Accent color of this card alone when played by a motion block (accent= in Markdown; ignored without scenes.type). |
scenes. | string or { src, alt? | Card background: a CSS color, "theme", "gradient", "pixel:, an image or muted .mp4 / .webm video path, or an object with background.src and background.alt. |
background.src | string | Required when scenes. is an object. Color, keyword, or image / video path of the card background. |
background.alt | string or Record<string, string> | Optional localized text alternative of scenes. (omitting alt on an image or video warns with webstory-). |
scenes. | "none" | "top" | "bottom" | "full" | Readability gradient over the card background ("none" when omitted). |
scenes.notes | string or Record<string, string> | Optional author notes in Markdown (:::notes), hidden in the player and used as the voice-over of the film (Scenes). |
scenes.attrs | Record<string, string | number | boolean> | Optional separator attributes (--- key=) not covered by a typed card field (Scenes). |
Commands
| Command | What it does |
|---|---|
recit init -- | a Lorem story of four cards |
recit dev launch.md | the player, reloaded on every save (--variant <id> previews one row) |
recit build launch.md | a static player and its backgrounds (--variant <id> builds one row) |
recit validate -- | schema, density, alt, cta last, missing backgrounds, with lines |
recit convert launch. | the JSON twin, and back with --to md |
recit convert launch. | the 9:16 film of the story, as film.json |
recit convert calendar. | the next events of a calendar (Bridges) |
recit convert report. | the figures of a report (Bridges) |
recit export launch. | one picture per card, or one folder per row with --variants (Images) |
recit export launch. | one folder per social preset (instagram-, tiktok, square…) |
recit export launch. | the same, one folder per language of i18n.locales |
recit render launch.md | the film of the story, or one MP4 per --preset (Film) |
AMP version
recit build also writes amp.html, a standalone AMP Web Story linked from index.html through
<link rel=. It keeps the cards, their backgrounds (image, video, color; a pixel:<seed>
texture becomes the theme fill), their headings and paragraphs, and the ::cta link. Motion blocks
(type=…) and polls (:::form) are reduced to their text, with a webstory- warning at
build time. Because AMP requires a poster and a publisher logo, the story needs an image cover, an
image background on its first card, or a signature logo (brand.logo); without one, amp.html is
skipped with a webstory- warning.
Images
recit export launch. captures each card of the built player alone, at rest
(?card=), in a 360×640 window at scale 3: one 1080×1920 PNG per card (1080×1350 in
4:5, 1080×1080 in 1:1), named 01-hook.png, 02-proof.png… and listed in exports.json.
--image-orformat jpeg webp,--scale 2,--cards hook,cta(or theimagessettings).--preset instagram-(story,tiktok instagram-,post square,linkedin-… ofpost MEDIA_inPRESETS @recit/core) captures one folder per preset at its exact size; listing them underimages.(front matter, twin, orpresets webstory.inimages. presets recit.) captures those presets withoutconfig.ts --preset, andrecit validatechecks every card against them (webstory-warning when estimated text or the call to action falls under a covered margin,safe- area webstory-error when a preset is for another ratio, andpreset- aspect chart-preseton a::chartwhose SVG text scales too small, overflows the card or crosses a safe area, raised to an error under--strict). The card checks are estimated without a browser; only the chart's text widths are measured in Chromium, in the story's theme font, when it is installed. Before each capture of a preset with a safe area, Chromium measures the tight bounding box of every text block and of the call to action on the settled card, and records any crossing as asafe-areawarning inexports.json(warnings) and on the console; inrecit dev, G (or the Safe area button) shades the same margins without touching the exported images or MP4.--all-captures every language oflocales i18n.locales, one folder each.- There is no PDF:
recit export --on a story says to useto pdf --to imagesorrecit render.
| Preset | Size | Aspect | Safe area (px) |
|---|---|---|---|
instagram- | 1080 × 1920 | 9:16 | top 250, bottom 340 |
tiktok | 1080 × 1920 | 9:16 | top 160, right 120, bottom 480 |
instagram- | 1080 × 1350 | 4:5 | — |
square | 1080 × 1080 | 1:1 | — |
linkedin- | 1080 × 1080 | 1:1 | — |
linkedin- | 1080 × 1350 | 4:5 (or 1:1) | — (1080 × 1080 on a 1:1 deck) |
og-image | 1200 × 628 | free | — |
mpu | 300 × 250 | free | — |
leaderboard | 728 × 90 | free | — |
The safe-area margins are documented starting values measured on the apps on 10 November 2026, not a promise from them: the apps move their buttons, and Récit updates the table with the date of each new survey.
Film
recit render launch.md renders a 9:16 film, one shot per card, through a closed mapping:
| Card | Shot |
|---|---|
type=… and its props | the same block, the same props, and the card's accent |
::chart or ::map | a still shot (styles flattened into the SVG; rise entrance for bar charts, fade else) |
| Markdown | the inference table of motion: a title alone, a quote, a list… |
image background, no type | a panel shot: the image, its headings and paragraphs as captions |
| color background, no text | a panel shot of that color |
color or pixel:<seed> under a shot | the theme of the film, with a warning |
| video background | a panel shot that plays the video, muted, for the card's duration |
dur, hold, :::notes | dur, hold, the voice-over |
brand (inFilm: true) | drawn on every shot (local logo embedded as a data: URI; omitted by default) |
::cta | lost (a link is not clicked in an MP4), with a warning |
A card outside the table is an error with its line, never a guess: set type= on it.
Bridges
| From → to | How | Owned by |
|---|---|---|
| webstory → motion | webstoryToFilm of @recit/ | @recit/ |
| motion → webstory | motionToWebstory of @recit/ | @recit/ |
| calendar → webstory | calendarToWebstory of @recit/ | @recit/ (the target) |
| report → webstory | reportToWebstory of @recit/ | @recit/ (the target) |
| book → webstory | bookToWebstory of @recit/ | @recit/ (the target) |
| webstory → webtoon | webstoryToWebtoon of @recit/ | @recit/ (the source) |
| glossary, directory → webstory | glossaryToWebstory, directoryToWebstory | @recit/ (the source) |
Each bridge returns its diagnostics beside its result and never throws on a story it cannot read. A bridge owned by its target reads only the fields of the source model it needs, so the dependency goes one way: the exception written on the Bridges page next to the calendar and atlas ones.
To a film and back
TypeScript
From a calendar
recit convert calendar. tells the next events of a calendar as a story: a title
card ("Coming up"), then one card per occurrence from the build day on, with its title, its date in
the calendar's zone and language, its place and a ::cta to its page when it has a url. Five
cards of events at most, a warning names the ones left out. A cancelled occurrence is skipped, the
description of an event does not cross (a card never summarises), and a calendar with nothing ahead
is an error that writes nothing. -o coming- writes the story's twin instead of Markdown.
From a report
recit convert report. tells the figures of a report: a title card, then, in the
order of the report, one card per item of a :::kpi (its :value as a heading, its label under it)
and one card per ::chart. The data directives cross as they are, with the data: of the report,
its paths rewritten from the folder of -o: the story computes its numbers at build time, like the
report. Prose, tables and callouts do not cross (a warning per section); a report with no figure, or
a :::kpi item without :value, is an error that writes nothing.
A story of the webstory format reads its own data: the same way: :value, ::chart, ::table,
:::kpi and ::map work in any card, drawn at the card's own social layout (story for 9:16,
portrait for 4:5, square for 1:1) so axis and marker labels stay legible on a phone without
CSS zoom (past 6 bars or 3 series, compilation warns with data-, and recit validate
checks each ::chart against the target presets as chart-preset).
From a book
recit convert book. tells a book as cards (bookToWebstory): a title card (the
title, the author, the description), then one card per chapter, in the order of the book. Each card
shows the chapter's number (« Chapter 2 », in the book's language, the part before it), its title,
and its opening as a quote: the :::epigraph of its first section with its source, else the first
sentence of its first paragraph, cut at a word past 180 characters. A chapter outside the numbering
(a preface) shows no number. The rest of the chapter does not cross: a card never summarises. A
chapter with nothing to quote keeps its title alone, with a warning; a book with no chapter is an
error that writes nothing; past 29 chapters, the story keeps the first ones and warns. --locale fr
tells the French book, as recit build does.
To a webtoon
recit convert story. (webstoryToWebtoon) turns a web story into a
webtoon episode, read from top to bottom: one panel per card, with the card's id, attributes and
notes. The background of the card becomes the image of the panel, with its description, or its
colour; a theme keyword leaves the episode's own background. Each heading, paragraph, quote or list
item of the card becomes one caption, stacked at the top of the panel, its emphasis kept; a
:::dialogue{cast mood} becomes a bubble of its speaker in the same stack, its shape the mood when
the mood names one (thought, shout, whisper). A card a panel cannot hold (a block with data, a
directive such as ::chart, a table, code, an image in the text) is an error with its line, and
nothing is written; the call to action, a video background and the targets of links are left out,
each with a warning. The images are written from the folder of -o, and -o episode.json writes
the episode's twin.
From a glossary or a directory
recit convert glossary. (or a directory) writes one card per term or entry, up to
30 cards, with the same { source, diagnostics } result (glossaryToWebstory and
directoryToWebstory of @recit/).
Packages
@recit/, in the 1.0 contract, has four subpaths: . (the model: storyToWebstory, the
settings and the budget), ./components (the player and its cards, with ./styles.css), ./bridge
(the bridges above) and ./runtime (the browser runtime of the built player).
In a page
In a Récit site, a story of the stories folder gets its player as its page, and a page embeds it:
MDX
On the fullscreen page of a site (publish.), a "Back to the site" link opens the
player's controls, before its buttons and over the card, so the card keeps the whole screen; it
leads to the site's home in the story's language. An embedded story has none. Outside a site,
StoryPlayer takes the same link as home:.