The document format
An Envy document is one JSON file (*.envy.json). Every runtime reads it as is. Missing fields are filled with defaults on load, so hand-written documents stay short. The JSON Schema is available from envy schema.
{
"format": "envy-ui", "version": 2, "id": "d_…", "name": "My game UI",
"description": "What this UI is for, read by implementers and AI agents",
"tokens": { "colors": { "accent": "#f2c14e" } },
"textStyles": { "H1": { "font": "Rajdhani", "size": 56, "weight": 700, "lineHeight": 1.05, "letterSpacing": 6, "uppercase": true } },
"assets": { "img_…": { "name": "…", "src": "data:image/png;base64,…", "width": 512, "height": 512 } },
"screens": [ { "id": "…", "name": "Main Menu", "root": "<node id>", "width": 1920, "height": 1080 } ],
"components": [ { "id": "…", "name": "Button / Primary", "root": "<node id>", "set": "…", "variant": { "Style": "Primary" } } ],
"componentSets": [ { "id": "…", "name": "Button", "props": [ { "name": "Style", "values": ["Primary", "Danger"] } ] } ],
"nodes": { "<id>": { } },
"animations": [ ],
"sampleData": { "player": { "hp": 72 } },
"scenarios": [ { "id": "…", "name": "Low health", "data": { "player": { "hp": 5 } } } ],
"i18n": { "base": "en", "tables": { "de": { "menu.play": "Spielen" } } }
}
Boards and nodes
Screens and components are both boards: a root node with no parent. Nodes live in one flat map and form a tree through parent and children; children order is paint order.
Node types: frame, button, text, image, progress, shape, instance. Frames and buttons have children; instances get theirs from their component. Any node can carry notes. Boards can also carry guides and layout grids for the editor, and a group and status for the editor and the handoff. status is stored as draft, progress, review or ready, shown as Draft, In progress, In review and Ready for dev. Runtimes ignore them.
A screen can also set:
| Field | Meaning |
|---|---|
transition |
How it appears: { "type": "fade", "duration": 0.3 }. See Screen transitions |
overlay |
How it behaves when opened over another screen: { "blockInput": true, "restoreFocus": true, "scrim": "#00000099" }. See Overlays |
safeArea |
true lays the screen out inside the display’s safe area |
sheet |
true marks a component sheet: a kit page shown on the Components page instead of Design. Runtimes don’t start on a sheet or list it with the game’s screens |
| Field | See |
|---|---|
layout (anchors, offsets, width, height, sizing, rotation) |
Layout |
container (mode, gap, padding, align, justify, wrap, lineGap, scroll, scrollbar) |
Layout |
style, text (with runs, fit, minSize), image, progress, shape |
Style |
instance (component, overrides, values) |
Components |
states, events.click |
Components, Data and events |
events.enter, events.leave, events.hover, tooltip, sounds |
Hover, tooltips and sound |
control (buttons only: slider, select, input) |
Controls |
bindings (a path or an expression), list (path, template, key, fill, empty) |
Data and events |
focus |
Focus |
text.key, tooltip.key, control.options[].key |
Localization |
profiles, activeProfile |
Device profiles. Editor only: runtimes ignore them |
Sounds
A sound is an assets entry with kind: "audio". Its src is a data: URL or a project path to a wav, ogg or mp3 file, and duration in seconds is optional. The sound travels inside the document, so the Godot, Unity and web exports carry it. See Hover, tooltips and sound.
"assets": { "snd_click": { "id": "snd_click", "kind": "audio", "name": "click", "src": "data:audio/ogg;base64,…", "duration": 0.12 } }
Colors
A color is #rgb, #rgba, #rrggbb, #rrggbbaa or a token reference like $accent. Token values are hex colors themselves, never other tokens.
Animations
{ "id": "…", "name": "Intro", "screen": "<screen id>", "duration": 1.4, "loop": false, "autoplay": true,
"tracks": [ { "id": "…", "node": "<node id>", "prop": "opacity", "keys": [ { "t": 0, "v": 0, "ease": "out" }, { "t": 0.5, "v": 1, "ease": "linear" } ] } ] }
See Animation.
Project files
A document with large images can travel as a project, a .envy zip:
doc.json the document, with asset paths instead of inline data
assets/<hash>.<ext> one file per image, font or sound, named by its content hash
Each image is stored once, however many layers use it, and the document text stays small enough to read and diff. .envy.json stays the single-file form, for sharing and for files you link in the editor. Both runtimes, the CLI (envy pack, envy unpack, envy inline) and the editor open projects.
Versions
The format has a version number, and older documents load through a migration step (normalizeDoc). Documents from version 1 and the older strata-ui format id are read as version 2 of envy-ui. A document with another format, or a version this build doesn’t know, is refused with a message that says why.
New fields are added within version 2, and a document that doesn’t use them loads as before. A runtime older than Envy 0.4.0 still reads a document that does use them, and skips the parts it doesn’t know. For example, it draws a control as a plain button, shows {expression} text as written, shows the plain content of styled text at its size, and ignores tracks on fill, radius, width, height and gradient stops.