Motion
Available format: turns a story into a film: every
scene is a shot, played by an animated block (title, chapter, statement, stat, list, compare
bars, UI mock, UI scene, text card, sprite, pixel, bars, line) in 16:9, 1:1, 9:16 or 4:5.
The Markdown syntax below and its parser are ready (@recit/). A film plays in a page
with <StoryEmbed slug=, and motion.recit.dev shows the
gallery in every aspect.
A motion story is written like a deck: front matter, scenes separated by ---, attributes on the
separator, :::notes. There is no second syntax. The Markdown is read through a closed inference
table: a scene whose shape matches no row is an error with its line number, never a guess.
A minimal story
hello.story.md
The first scene is a title (a line, then a # heading), the second a statement (one paragraph,
the bold run is underlined in the accent), the third a stat, which is never inferred and so
declares type=stat.
Scenes and attributes
Each scene starts with a separator. Its attributes are the canonical way to set a scene:
Markdown
| Attribute | Role |
|---|---|
id | stable id of the scene, used by edits. Default: s1, s2… |
type | block of the scene. Inferred from the content when absent, except stat |
dur | duration in seconds, instead of the computed reading time |
hold | extra seconds held after the motion settles |
accent | accent colour of this scene alone, replacing the theme accent (highlighted bar, curve, underline of emphasised words) |
motion | Ken Burns movement of an image: zoom-in, zoom-out, pan-left, pan-right |
audio | audio track of this scene alone (a recorded voice), relative to the story; experimental |
layout | deck layout: cover is a title, section a chapter, quote a statement |
| any other key | a prop of the block (kicker, number, unit, caption…), checked by block |
A value with spaces is quoted: caption=. An attribute that is not a
prop of the block is an error (unknown attribute "color"), and so is a prop set both by an
attribute and by the content.
accent= sets the accent colour of one scene without changing the rest of the film:
Markdown
A scene that holds a single local image becomes a panel shot sized from the file, with optional
motion= on the separator:
Markdown
HTML comment alias
An HTML comment on the first line of a scene is an alias of the separator attributes. It stays invisible on GitHub:
Markdown
When both set the same key, the separator wins. Rewrites always emit the separator form.
Inference table
A scene without type is read by its shape. The table is closed: a shape that is not listed is an
error.
| Markdown shape | Block | Props |
|---|---|---|
# Heading alone | title | heading → text |
a line, then # Heading | title | line → kicker, heading → text |
## Heading alone | chapter | heading → title; ## 01 · Title → number and title |
| one paragraph | statement | text → text, bold runs → emphasis |
| optional heading, then a bullet list | list | heading → title, items → items |
optional heading, then a label/before/after table | compare-bars | heading → title, rows → rows, unit as an attribute |
 alone | panel | local image → image (sized from the file), optional motion= |
type=stat, never inferred | stat | # heading → value, line → label, italic or quote → caption |
type=ui-mock, type=, type=still | same | a ```yaml block holds the props (still animates an SVG figure) |
a > quote of one paragraph | statement | as one paragraph |
:::textcard{variant= alone | textcard | the card's Markdown and attributes (Text cards) |
:::dialogue{cast= alone | textcard | a quote card: the line → text, the speaker's name from the bible → attribution |
::sprite{…} alone, optional caption paragraph | sprite | attributes of the directive (Sprite sheets) |
```pixel fence, optional caption paragraph | pixel | legend and grid → legend and grid, fence attributes (Pixel art) |
::pixel{gen=, optional caption paragraph | pixel | generated grid and legend, directive attributes (Pixel art) |
type=bars, never inferred | bars | a ```yaml block holds items and optional props (Bars and line charts) |
type=line, never inferred | line | a ```yaml block holds points and optional props (Bars and line charts) |
The heading of a list or a compare-bars may have any level. With an explicit type, a block
also accepts its close variants: type=title (or layout=cover) takes the kicker before or after
the heading, and type=chapter (or layout=) takes a # heading.
Blocks
Markdown
Numbers in a compare-bars table are numbers: 42, 3.5, -2. Anything else is an error, since
no metric is ever made up.
On screen, a compare-bars shot puts its title above the chart, as bars and line do, and
names its two bars in a legend under it: Before and After, or Avant and Après when
the story's language is French. The legend sits at the size of the row labels, so the two bars are
never told apart by their colour alone.
Text cards
A scene made of one :::textcard{variant= — or --- type= on the separator
with the card's Markdown directly in the scene — plays as a textcard shot (motion and webstory
only in v1): a card of text fitted to the frame, animated with the entrance of the block its variant
dresses (statement, title, stat or list).
Markdown
See Text cards on the webstory page for the five variants,
content shapes and attributes (variant, background, source, id, mark). A mark (a
watermark) stays still in the bottom corner of the safe area while the text enters.
Sprite sheets
::sprite{character pose} draws one pose (one row) of a character's sprite sheet — declared with
::sheet{src layout} in the bible named by cast:, or passed
directly with src= and layout= — by framing its cell through an SVG viewBox over the sheet. As
a compiled HTML directive (such as a webstory card), under
prefers-, or when frame= is set, it shows a still image (frame, 0 by default).
In a film without frame=, a scene holding one ::sprite{…} and an optional caption paragraph (or
--- type= on the separator) plays the row's frames from their
cumulative durations: two plays of a loop pose, or one play of a once pose holding its last
frame.
Markdown
| Attribute | Values | Default | Role |
|---|---|---|---|
character | character id in cast: | none | Character of the bible with a ::sheet (character or src required) |
src | local path or URL | from character | Sprite sheet image when character is not used |
layout | codex-pet-v1 | codex-pet-v1 | Sheet grid and row timings (1536×1872 px, 8×9 cells of 192×208 px) |
pose | idle, running-, running-left, waving, jumping, failed, waiting, running, review | idle | Row of layout to show |
loop | loop, once | row's playback | Overrides the row's playback (waving, jumping and failed default to once; the others to loop) |
frame | non-negative integer (0, 1…) | 0 (still) / played | Fixed frame index in pose (0 by default in still cards and under prefers-) |
alt | string | none | Accessible description (role="img"); omitting or blanking it emits a sprite-alt warning |
caption | string | none | Caption under the sprite (or one paragraph below ::sprite in a film, never both) |
id | string | none | Stable id of the image across languages |
Pixel art
The pixel block draws a pixel-art sprite from data — a character grid and a colour legend, with no
image file — as crisp-edged SVG (shape-, merged <rect> runs per colour).
With reveal=scan, its rows draw from top to bottom over 1 s; with reveal=, its cells
appear in a fixed scattered order over 1 s; multi-frame grids play at fps (4 by default) and
keep the scene on screen for the reveal plus two loops of the frames, or of the colour cycle when
it is longer (caption fades in once drawn and is read for duration; under
prefers-, frame 0 is held with all rows drawn).
Two Markdown forms name a pixel scene (type=pixel on the separator is optional), each followed
by an optional caption paragraph (never both caption= and a paragraph):
- A
```pixelfenced block for a hand-drawn sprite. The opening fence takeskey=valueimage attributes (id,alt,caption,scale,fps,reveal,cycle). Inside the fence, write the legend first, onechar =per line (colour charis one non-space character;colouristransparent, a theme token —bg,surface,text,muted,accent,data.peach,data.mint,data.,beforeBar data.,beforeNum data.,afterBar data.— or a hex colourafterNum #rgb,#rgba,#rrggbb,#rrggbbaa), then a blank line and the grid of equal-width rows (up to128×128cells). Additional grids separated by blank lines are animation frames of the same size (up to32frames). - A
::pixel{gen=leaf directive for a deterministic sprite generated from a seed (32-bit integer PRNG). It takes the recipe attributes below alongside the image attributes (sprite …} id,alt,caption,scale,fps,reveal).
Markdown
| Prop | Values | Default | Role |
|---|---|---|---|
grid | string[] or string[][] (1–32 frames, up to 128×128 equal-width rows) | required | Rows of one frame, or frames of rows, built from the fence or ::pixel recipe |
legend | Record<char, colour> (transparent, theme token or #rgb/#rgba/#rrggbb/#rrggbbaa) | required | Maps each single non-space grid character to a colour |
id | non-empty string | none | Stable id of the image across languages |
alt | non-empty string | none | Accessible description (role="img"); omitting or blanking it emits a pixel-alt warning (an error under --strict) |
caption | non-empty string | none | Line under the sprite, read for duration (or one paragraph below the fence or directive, never both) |
scale | auto, integer 1–64 | auto | Display size in px per cell; auto fits the frame |
fps | number > 0 and <= 60 | 4 | Frames per second of a multi-frame grid |
reveal | scan, dissolve, none | none | Entrance animation over 1 s: scan draws rows top to bottom, dissolve shows cells in a fixed scattered order; none shows everything immediately |
cycle | 2–16 legend keys, each once (cycle=abc) | none | Colour cycling: each key takes the colour of the next one in the list, one step per frame at fps, as water or fire in pixel art |
Recipe attributes of ::pixel{gen= and ::pixel{gen=:
| Attribute | Values | Default | Role |
|---|---|---|---|
gen | sprite, noise | required | Seeded generator: a mirrored character (sprite) or a scattered texture (noise) |
seed | integer 0–4294967295, or non-empty string up to 64 characters | required | Seed of the deterministic 32-bit generator |
mask | humanoid, creature, or equal-width rows of . # o ? * joined by | | humanoid | Half-mask sampled by the seed (. empty, # outline, o body, ? body/empty, * body/outline) |
mirror | x, y, xy, none | x | How mask is mirrored into the sprite (within 128×128 cells after mirroring) |
palette | ink, moss, dusk, ember, tide | none | Named palette: its outline, body and shade; a colour written beside it wins |
outline | transparent, theme token or hex colour | text | Colour of # cells and empty 4-neighbours around the body |
body | transparent, theme token or hex colour | bg | Colour of o and sampled body cells |
shade | transparent, theme token or hex colour | none | Optional colour for body cells with no body cell directly below |
variants | integer 1–32 | 1 | Frame count: frame 1 is the base sprite, subsequent frames re-sample * cells |
gen=noise draws a seeded texture for a background or a starfield: about density percent of its
cells take body (half of those take shade when it is set), the others stay transparent, with no
outline. Each variant is drawn again from its own seed. It refuses mask, mirror and outline,
and gen=sprite refuses the three attributes below.
| Attribute | Values | Default | Role |
|---|---|---|---|
width | integer 1–128 | 16 | Columns of the texture |
height | integer 1–128 | 16 | Rows of the texture |
density | integer 0–100 | 50 | Percent of cells filled with body |
Markdown
Bars and line charts
bars draws 1 to 12 vertical bars rising from the bottom on a shared axis (0.3 s start,
0.08 s stagger, formatted values fading in above each bar). line traces a polyline curve of 2
to 60 points from left to right in the accent colour (0.3 s to 1.5 s), with horizontal axis
labels (first, last, and middle above 6 points) and a value callout on the active point.
Neither block is inferred from a Markdown table (@recit/ only reads
label | before | after tables as compare-bars). A scene declares type=bars or type=line on
the separator and passes its { label, value } rows in a ```yaml (or ```json) block
(items for bars, points for line); scalar props (title, unit, highlight, source) may
sit in the YAML mapping or on the separator. When the CLI builds a format: story with
data: tables, an untyped ::chart{type= (1 to 12 non-negative single-series rows
without gaps) or ::chart{type= (2 to 60 single-series points without gaps) also
compiles to a bars or line shot, taking the scene's first heading as title (other chart shapes
stay still). A scene with a :::form{url= is the film's end screen, a still of its QR code
and address (Forms).
Markdown
| Prop | Block | Values | Default | Role |
|---|---|---|---|---|
items | bars | 1–12 { label: rows (value >= 0) | required | Bars in order on a shared axis (label non-empty) |
points | line | 2–60 { label: rows (negatives allowed) | required | Curve points in order along the horizontal axis (label non-empty) |
title | bars, line | string | none | Label shown above the chart |
unit | bars, line | string | none | Unit suffix formatted with values (such as "%") |
highlight | bars, line | string | none (line calls out last) | label of the bar drawn in the accent colour, or of the point marked with an accent dot and value |
source | bars, line | non-empty string | none | Source line drawn under the chart |
A described character (preview)
A story whose front matter names a bible with cast: can play a character the bible describes (its
model, see Images of an animation): in a pose, or
playing one of its cycles from the start of the scene. The scene attributes name it, or one
::character{…} and an optional caption line:
Markdown
animation= is a cycle of the model, pose= and expression= hold a pose instead, render= picks
a vector, pixel or frames render of the model and variant= one of its variants (a frames
render plays the images generated for the animation, see
Images of an animation); anything the model does not
declare is an error with its line. The CLI resolves the character to its model and the film carries
it whole, so the player reads no file. A scene stays for two plays of a looping cycle, one of a
cycle played once; under prefers-, the first image is held. The block needs
@recit/, an optional peer of @recit/, and a film without a character
leaves it out of the player.
The ```yaml escape hatch
A scene made of one ```yaml (or ```json) block takes its props from it, whatever the block.
Everything a film.json can say stays possible in Markdown, including the blocks of a third-party
pack. The separator must name the block with type=, and scalar props may still be attributes:
Markdown
Voice-over
:::notes becomes the voiceover of the scene: the text read over the shot, or its caption. It is
never drawn by the blocks. A voice-over longer than the text on screen keeps the scene on screen
longer (its words at wordsPerSecond).
Markdown
Each voice-over is one caption over its scene (filmCues, the .vtt of recit render). When the
voice of a scene is timed (a speech provider that returns timings, such as ElevenLabs through
@recit/ai), filmCues(film, timing, { voices }) cuts it in step with the voice: one caption per
sentence, or before it passes two lines of 42 characters. A voice that says another text, or runs
past its scene, keeps the single caption.
Errors
The parser never guesses. Every problem names the file, the line and the block:
Code
Code blocks, math, images mixed with text (or remote images), raw HTML, directives such as :::card
and the deck layouts grid, columns, split and image-* have no motion block yet: they are
errors, not silently dropped. A deck written for slides renders as a film when its scenes keep to
the table above. Its :::step blocks are shown with the scene, and each one holds the shot one more
second (an explicit hold= wins); bullet lists split across steps make one list.
Settings
Settings go in the front matter of the story.
| Key | Value | Default |
|---|---|---|
title | label of the film | none |
format | motion | deck |
aspectRatio | 16:9, 1:1, 9:16 or 4:5 (alias: aspect) | 9:16 |
theme | marques, warm-, saas-product or an import | marques |
wordsPerSecond | narration pace that sets scene durations | 2.2 |
audio | soundtrack path or { src, fadeOut } | none |
Settings are flat, like every format. A nested motion: block is accepted as well, and the
motion: section of recit. gives the defaults of a project. Precedence: flat key, then
the nested motion: block, then recit.. A theme can also come from theme.name, the
named theme a story shares with its deck: warm- and saas-product
are the same tokens in both formats. A film with no theme takes marques, the film of the "Marques"
direction (an ink frame, white titles in Red Hat Display); name warm- to keep the cream
frame and the serif of the films made before.
recit.config.ts
audio adds a soundtrack under the whole film (mp3, m4a, wav or ogg, resolved relative to
the story), written as a path string (audio:, 1.5 s fade-out) or as
audio: (0 to 30 s; also read from motion.audio). During
recit render, ffmpeg (required) mixes the track under the rendered video and cuts it at the end
of the film with the fade-out; the soundtrack counts towards the MP4 size and --max-bytes.
audio= on a separator gives one scene its own track (--- type=):
recit render plays it from the scene's first frame, cuts it at its last and mixes it over the
soundtrack at full level. The field is audio in the JSON twin and in film.json, says nothing
about where the file comes from, and is experimental (x-). A web story
turned into a film keeps the audio= of each card. A missing file stops the render before the first
frame, naming the scene.
The JSON twin
A motion story has three interchangeable forms. All of them end in the same validated film.
| Form | File | Role |
|---|---|---|
| Markdown | hello. | written by people, read on GitHub |
| typed JSON twin | hello. (kind:) | the Markdown as typed JSON, scene by scene |
| film | hello. (version, scenes) | the render model: one block and its props per scene |
hello.story.json
A scene of the twin has typed fields: type, dur, hold, accent, props (the ```yaml
block), voiceover (the :::notes), then attrs for the other separator attributes (unit…) and
body for the natural Markdown form. settings holds aspectRatio, theme, wordsPerSecond and
audio (settings. or settings.). In a film.json, each scene carries id,
type, props and the optional dur, hold, accent and voiceover.
recit convert turns the Markdown into its twin and back. A film.json turns into Markdown with
filmToMarkdown: the output is canonical, with an id= on every separator, the natural form of
each block and a ```yaml block for props without one. Writing a film back to a .md file
rewrites the whole story in this canonical form (v1): comments, blank lines and front matter keys
other than the film settings are not kept.
Commands
Outside a site, recit build hello.md builds the film page alone: index.html with the film,
assets/ (the player, React in its production build), assets/ and the local media
the film names, in ./dist (-o to change it). recit dev hello.md previews it; on a 9:16,
4:5 or 1:1 film, G (or the Safe area button) shades the margins covered by the chosen
network preset (instagram-, tiktok, instagram-, square, linkedin-) without
touching a built page or an MP4. recit render hello.md writes <story>.mp4, <story>.vtt and
<story>.txt (--preset instagram- renders one <story>. per preset of
MEDIA_ at its ratio, and --aspect 9: renders one <story>. per ratio
into the output folder) and records each MP4 in exports.json (kind: "mp4").
recit validate hello. (and --burn- to reserve the caption
band) measures each scene's middle frame against the preset's safe area without rendering an MP4:
crossings are safe-area warnings, or errors under --strict (needs Chromium like recit render,
not ffmpeg).
Bridges
A film is the target of most bridges, and the source format owns each of them (Bridges):
| From → to | How | Owner |
|---|---|---|
| deck → motion | format: in the front matter (or <StoryEmbed format=) | @recit/ |
| webtoon → motion | webtoonToFilm | @recit/ |
| webstory ⇄ motion | webstoryToFilm, motionToWebstory | @recit/ |
| atlas → motion | atlasToFilm | @recit/atlas |
A deck written for slides plays as a film when its scenes keep to the
inference table; a scene with no motion block is refused at its line
(Errors). webtoonToFilm and webstoryToFilm return { film?, like
storyToFilm (Packages); atlasToFilm returns the film itself.
Playing a film in a page
In a Récit site, a motion story published by publish: plays in the page with the browser engine of
@recit/: no Remotion, no MP4. Its fullscreen page is /present/ (the
routePrefix).
MDX
| Prop | Role |
|---|---|
format | motion plays a deck story as a film when its scenes fit the table above |
aspect | 16:9, 1:1, 9:16 or 4:5, instead of the story's |
time | opens paused at this second; ?t=<seconds> in the URL does the same |
autoplay | plays once visible (default), never under reduced motion |
loop | starts over at the end (default) |
poster | a still, shown by the server-rendered page until the player loads |
src | a pre-rendered MP4, played by the server-rendered page until the player loads |
The player is frame-accurate: a paused frame is the frame of the MP4. Space plays and pauses, ← and → seek one second.
A :::scroll{film= block in a site page plays the film by the reader's scroll
instead of a clock: its ::::step{at= children pin the text that shows at each position (see
Scroll stage in site pages).
Packages
| Package | Role |
|---|---|
@recit/ | film schema (parseFilm), blocks, timing, ops, handover |
@recit/ | parseFilmSource, formatOf, storyToHandover, storyToFilm, parseMarkdownFilm, filmToMarkdown |
@recit/ | readFilmFile, writeFilmFile: .json and .md films on disk |
@recit/ | the React blocks and themes, played in the browser |
@recit/ | MP4 and stills: Chromium through Playwright, and ffmpeg |
@recit/mcp | the MCP server: agents build, edit and render films |
TypeScript
A compiled story becomes a film through storyToFilm, which returns { film? like
every …ToFilm: the film only when no diagnostic is an error, and the Diagnostic of
@recit/core with the file, sceneId and blockType of each scene. toFilmSourceResult turns
it into the { ok, … } of readFilmFile.
TypeScript