Use this page to check the keys every slide’s frontmatter takes, whatever its layout: layout, title, surface, background, budget, transition and hidden. A layout adds its own keys (eyebrow, align, stats and so on); those are on each layout’s page under layouts.
Keys
layout
| Field | Type |
|---|---|
layout | string |
title
| Field | Type |
|---|---|
title | string (non-empty) |
surface
| Field | Type |
|---|---|
surface | string |
background
| Field | Type |
|---|---|
background | "none" | string (non-empty) | object |
.srcrequired | string (non-empty) |
.fit | "cover" | "contain" |
background.focal
| Field | Type |
|---|---|
background | object |
.xrequired | number (0 to 100) |
.yrequired | number (0 to 100) |
background (continued)
| Field | Type |
|---|---|
.opacity | number (0 to 1) |
background.tint
| Field | Type |
|---|---|
background | object |
.rolerequired | "bg" | "surface" | "fg" | "accent" |
.opacityrequired | number (0 to 1) |
background (continued)
| Field | Type |
|---|---|
.layers | "replace" | "over" |
budget
| Field | Type |
|---|---|
budget | string |
transition
| Field | Type |
|---|---|
transition | "none" | "fade" | "slide" | "rise" | "push" | "cover" | "wipe" | "zoom" |
hidden
| Field | Type |
|---|---|
hidden | boolean |
layouts.json · slideFrontmatter
The table gives each key’s type, allowed values and limits. It marks no key as required: whether a layout needs title is on that layout’s page under layouts. What each key does and its default:
| Key | Default | What it does |
|---|---|---|
layout |
default |
The layout the slide fills, by name in kebab-case. deck layouts lists the names. |
title |
the slide’s first heading, else its id | The slide’s name in the outline, the presenter window and the slide’s accessible label. Some layouts also set it on the slide and limit its length. |
surface |
the layout’s default surface, else default |
The brand surface the slide is painted with, such as inverse or accent. It must be a surface of the deck’s brand; the build fails otherwise and suggests the closest name. See brands and surfaces. |
background |
the surface’s own background | none hides the surface’s background layers. An image path paints that image instead of them. The object form takes src and options: fit (cover, the default, crops around focal; contain shows the whole image), focal ({ x, y } in percent, default the centre), opacity (0 to 1, default 1), tint ({ role, opacity }, a colour of the surface laid over the image: bg, surface, fg or accent) and layers (replace, the default, or over to paint the image above the surface’s layers). See media. |
budget |
none | How long you mean to speak on the slide: minutes and seconds, such as 90s, 2m or 1m30s (up to 999 minutes and 9999 seconds). The presenter window paces against it, and the time-budget lint rule adds the budgets up against the deck’s duration. See speaker notes. |
transition |
the brand’s transition | The transition for the move between the previous slide and this one, both ways: none, fade, slide, rise, push, cover, wipe or zoom. See transitions and morphs. |
hidden |
false |
true keeps the slide in the deck and the build and skips it in a talk: next and previous pass over it, exports leave it out, and its budget is not counted. A link, the slide sidebar and go-to still open it. Anything but true or false is a schema error. New in 0.5.0. See hidden slides. |
The table shows budget as a plain string because the schema cannot carry its pattern; the build checks it.
In MDX
The keys go in the --- block at the top of the file. See MDX slides.
---
layout: statement
title: Claim
surface: accent
budget: 45s
transition: fade
---
Ship it on *Monday*.In TSX
A TSX slide exports a frontmatter object. The build reads it without running the slide, so it must be a literal; satisfies SlideFrontmatterInput makes your editor check it. This is the hello deck’s live-counter slide:
import { Notes, Step, useStep, type SlideFrontmatterInput } from '@deckster/engine';
/**
* Read by the build without running the slide, so it must stay a literal.
*/
export const frontmatter = {
title: 'A TSX slide',
surface: 'accent',
budget: '45s',
} satisfies SlideFrontmatterInput;See TSX slides.
Errors
A key that neither the slide nor its layout defines is refused, so a misspelled key never passes. The fix suggests the closest key only for a near miss (surfce becomes surface); for a key another layout takes, it names the layouts that have it; otherwise it lists the known fields. A bad value names the key, what was expected and how to write it. deck build fails on either, and deck lint reports them as schema errors:
$ deck lint launch-review
decks/launch-review/slides/claim.mdx
error schema (claim): "surfce" is not a frontmatter field.
Fix: Rename it to "surface".
error schema (claim): budget: Expected a duration such as "90s", "2m" or "1m30s", got "2 minutes".
Fix: Write the speaking time as minutes and seconds, for example `budget: 90s` or `1m30s`.
launch-review: 2 errors, 0 warnings.