Layers
The Layer union — image, vector, video, audio, text and plugin layers, the content widgets (download, audio player, video modal, scroll text, iframe), LayerCommon, positioning and z-order.
A panel's artwork is a stack of layers. Layer is a union of eleven kinds, discriminated by the required kind property: image, vector, video, audio, text, plugin and — since format 1.10 — the content widgets download, audioPlayer, videoPlayer, scrollText and iframe. All kinds share the LayerCommon base for identity, stacking, opacity, transforms, and conditional visibility.
{ "kind": "image", "id": "ly-bg", "assetId": "img-alley", "z": 0 }
A layer without a valid kind fails validation against every branch of the union, producing a wall of oneOf errors. Check kind first. See Validation.
Shared properties (LayerCommon)
| Property | Type | Default | Description |
|---|---|---|---|
id | Identifier | — | Layer ID (used by variants to override matching layers) |
z | number | — | Stacking order within the panel — higher renders on top |
opacity | number 0–1 | 1 | Layer opacity |
parallaxDepth | number | 0 | Parallax factor; 0 = static, higher values move more with viewport motion |
dragReveal | boolean | NormalizedRect | — | Layer is revealed by dragging; a rect constrains the reveal area |
transform | object | — | x (number), y (number), scale (number ≥ 0.01, default 1), rotation (number, default 0) |
visibleIf | JsonLogic | — | Layer only renders when this evaluates truthy against variables |
name | string | — | Human-friendly layer name (authoring aid) |
There is no blend-mode property in the current schema — compositing is plain alpha stacking via z and opacity.
Editor fields
LayerCommon also admits fields written by the CMS editor: x, y, width, height, scaleX, scaleY, rotation (editor transform), locked, visible (editor state), and content, fontFamily, fontSize, fontWeight, color, align, verticalAlign (editor text styling). They are valid on any layer kind. Most of them are authoring metadata, but x, y, width and height also place a layer in the reference player — see Placement. Everything else at runtime is driven by transform, z, opacity, and the kind-specific fields.
Layer kinds
ImageLayer (kind: "image")
| Property | Type | Required | Description |
|---|---|---|---|
assetId | Identifier | Yes | Image catalog asset |
clipRect | NormalizedRect | — | Crop the source image to this region |
visibleRect | NormalizedRect | — | Visible area of the layer; if omitted the full layer is visible. Hidden areas render at reduced opacity in the editor |
VectorLayer (kind: "vector")
| Property | Type | Required | Description |
|---|---|---|---|
assetId | Identifier | Yes | Vector catalog asset (SVG/PDF) |
VideoLayer (kind: "video")
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
assetId | Identifier | Yes | — | Video catalog asset |
muted | boolean | — | false | Mute playback (work default: settings.ui.videoMutedDefault) |
startAtMs | integer ≥ 0 | — | — | Start offset on the media timeline |
playMode | string | — | "once" | once | loop | pingpong | loop-from (schema 1.1+) |
loopFromMs | integer ≥ 0 | — | — | Loop re-entry point for loop-from (semantic rule: startAtMs <= loopFromMs < durationMs) |
startMode | string | — | "on-view" | on-view | on-hover | on-click (schema 1.1+) |
controls | boolean | — | false | Show native video controls (schema 1.1+) |
autoplay | boolean | — | false | Legacy (1.0) — superseded by startMode; only interpreted when startMode is absent |
loop | boolean | — | false | Legacy (1.0) — superseded by playMode; only interpreted when playMode is absent |
Full playback semantics, the legacy-field mapping, and reverse variants are covered in Video.
AudioLayer (kind: "audio")
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
assetId | Identifier | Yes | — | Audio catalog asset |
loop | boolean | — | false | Loop playback |
gain | number 0–2 | — | 1 | Volume multiplier |
startAtMs | integer ≥ 0 | — | — | Start offset |
Panels more commonly use the Panel.audio array of AudioTracks (which adds role and visibleIf) — see Audio.
TextLayer (kind: "text")
Only kind is required.
| Property | Type | Description |
|---|---|---|
text | LocalizedString | Localized text content |
content | string | Plain-string alternative to text (written by the CMS) |
styleRef | Identifier | Schema 1.3+. Name of a reusable preset in settings.typography.textStyles. Unknown names are ignored |
style | TextStyle | Inline styling: font (string), sizePt (number 4–200), color (ColorHex), strokeColor (ColorHex), strokeWidth (number 0–20). When styleRef is also set, inline fields override the preset field-by-field |
When many layers share the same look (e.g. every caption of an album), define it once in settings.typography.textStyles and reference it via styleRef instead of repeating identical style blocks. Resolution cascade: work typography defaults → preset → inline style.
PluginLayer (kind: "plugin")
| Property | Type | Required | Description |
|---|---|---|---|
plugin | PluginInstance | Yes | The plugin instance to render in this layer |
Content widgets (format 1.10)
Five layer kinds are reader-facing controls drawn by the player instead of artwork: download, audioPlayer, videoPlayer, scrollText and iframe. Their look comes from the work's ui.theme. They are interactive: clicks, keys and scrolling inside a widget never advance the panel. In the CMS they are added from Add Content — see Content Widgets.
A widget's box is x/y/width/height in the panel's reference space; width and height are required for these kinds. visibleIf applies as on any layer.
Shared fields (WidgetLayerCommon)
| Property | Type | Default | Description |
|---|---|---|---|
title | LocalizedString | — | Heading and accessible name of the widget (required on iframe) |
appearance | "card" | "plain" | "card" | card: themed surface with border, radius and shadow. plain: only the control itself, on the artwork |
themeOverrides | ThemeColors | — | Per-layer colour overrides (rare); fonts and shape are work-wide only |
print | "card" | "hide" | "card" | Print renders (PDF export): card shows a static card — the export can add a QR code that opens the panel in the online reader; hide leaves the widget out and the artwork shows through |
DownloadLayer (kind: "download")
| Property | Type | Default | Description |
|---|---|---|---|
assetId | string | — | Required. A catalog item of category file |
fileName | LocalizedString | variant fileName | Display name and download name |
description | LocalizedString | — | One line under the name |
showIcon | boolean | true | File-type icon from the variant's mime / extension |
showSize | boolean | true | Size from the variant's sizeBytes |
AudioPlayerLayer (kind: "audioPlayer")
| Property | Type | Default | Description |
|---|---|---|---|
assetId | string | — | Required. An audio catalog item; its waveform is drawn when present |
showWaveform | boolean | true | Waveform to click or drag through; a progress bar without peaks |
showTime | boolean | true | Position and duration |
duckMusic | boolean | true | Lowers the music and ambience buses while playing |
startAtMs | integer ≥ 0 | 0 | Initial position |
keepPlaying | boolean | false | Keeps playing when the reader moves to another panel or page — until the audio ends, the reader pauses it or another audio/video widget starts |
The player never starts it on its own, and one widget plays at a time. By default it pauses when the reader moves to another panel — also when that panel's widget is still on screen (page view, canvas view). With keepPlaying it plays on, also after its panel has left the screen; the widget shows it playing again when the reader comes back.
VideoPlayerLayer (kind: "videoPlayer")
| Property | Type | Default | Description |
|---|---|---|---|
assetId | string | — | Required. A video catalog item (a playable variant and its poster) |
trigger | "poster" | "button" | "poster" | What the panel shows; activating it opens the video in a modal with its own controls |
autoplayInModal | boolean | true | Start when the modal opens |
showDuration | boolean | true | Length on the poster |
ScrollTextLayer (kind: "scrollText")
| Property | Type | Default | Description |
|---|---|---|---|
text | LocalizedString | — | Required. The text |
format | "plain" | "markdown" | "plain" | markdown is a safe subset: ##–#### headings, paragraphs, bold, italic, lists, inline code and links (opened in a new tab). No HTML, images or tables |
styleRef | string | — | A textStyles preset; default the theme's body font |
IframeLayer (kind: "iframe")
| Property | Type | Default | Description |
|---|---|---|---|
src | string, pattern ^https:// | — | Required. The page to embed |
title | LocalizedString | — | Required. Accessible name |
allow | array of fullscreen, autoplay, encrypted-media, picture-in-picture, clipboard-write | ["fullscreen"] | The iframe allow attribute; camera, microphone and location are not offered |
sandbox | "default" | "strict" | "none" | "default" | default: scripts, same origin, forms, pop-ups. strict: scripts only. none: no sandbox |
lazy | boolean | true | Mounted only while its panel is current |
showOpenLink | boolean | true | "Open in new tab" link — the fallback for sites that refuse framing |
{
"kind": "download", "id": "ly-worksheet", "z": 11,
"x": 60, "y": 660, "width": 620, "height": 110,
"assetId": "file-worksheet",
"fileName": { "en-US": "Worksheet 3.pdf", "de-DE": "Arbeitsblatt 3.pdf" },
"description": { "en-US": "Print and fill in" }
}
In print (the lettered PDF) widgets render static: a download card, the waveform, the poster, the text from the top with a "continued" note, and the iframe's title and address.
Positioning and z-order
- Stacking: layers render in ascending
z. Speech bubbles and hotspots render above the layer stack. - Coordinates: geometry fields that are
NormalizedRect/NormalizedNumber(clipRect,visibleRect,dragReveal) are fractions of the panel box — resolution-independent.transform.x/yoffset the layer;transform.scale/rotationapply around the layer. - Parallax:
parallaxDepthshifts layers at different rates during viewport motion for a depth effect (e.g. background0, midground0.3, foreground0.6).
Placement
A layer's x, y, width and height are in the panel's reference space: 1024 units tall and 1024 × aspect wide, where aspect is the width / height of the panel's artwork (its background image, else the first image or video with known dimensions, else 16:9). This is the space the CMS editor authors layers in, and it does not depend on the size the panel is shown at.
| Layer | Placed |
|---|---|
Background — the first image layer at z 0 (a missing z counts as 0) | Always over the whole panel; its x/y/width/height are ignored and the CMS leaves them out |
| Every other layer | At its rect, in percent of the panel box: left = x / referenceWidth, top = y / 1024, and so on. A missing width or height means the full reference extent |
A text layer's fontSize is in the same units, so captions keep their size relative to the panel on every screen.
{ "id": "sign", "kind": "image", "assetId": "sign", "z": 2,
"x": 640, "y": 96, "width": 512, "height": 256 }
In a 16:9 panel (reference space 1820 × 1024) this layer starts at about 35 % from the left and 9.4 % from the top, and is about 28 % wide and 25 % tall.
The reference player places layers this way since 1.8.0 (released 2026-10-19; the CMS preview, reader app and PDF export use it). Earlier versions drew every layer full-panel and used x/y as raw pixel offsets, so overlays appeared in the wrong place. Manifests the CMS publishes since 2026-10-19 keep width and height on every layer but the background; republish a work to pick this up.
AssetRef
The schema defines a general-purpose asset reference form:
{ "assetId": "img-alley", "variant": "alley-2048.avif", "locale": "de-DE" }
An AssetRef is one of: a plain Identifier (catalog ID), an absolute Uri, or an object with required assetId plus optional variant and locale to pin a specific variant or localization. Layer assetId fields themselves are plain Identifiers; automatic variant/locale selection is described in Assets.
Example
A layered panel with parallax, a conditional overlay, and a caption:
{
"layers": [
{ "kind": "image", "id": "ly-bg", "assetId": "img-alley", "z": 0, "parallaxDepth": 0 },
{ "kind": "image", "id": "ly-mid", "assetId": "img-detective", "z": 10, "parallaxDepth": 0.3 },
{
"kind": "image",
"id": "ly-overlay",
"assetId": "img-overlay-left",
"z": 20,
"opacity": 0.4,
"visibleIf": { "==": [ { "var": "path.choice" }, "left" ] }
},
{
"kind": "text",
"id": "ly-caption",
"z": 30,
"opacity": 0.95,
"text": { "en-US": "Left path chosen.", "de-DE": "Linker Pfad gewählt." },
"styleRef": "caption",
"style": { "sizePt": 16 }
}
]
}
The caption references the work's caption preset from settings.typography.textStyles and only overrides the size inline — see Settings.