---
title: "Slide frontmatter"
description: "Every frontmatter key a slide accepts."
---

> Documentation Index
> Fetch the complete documentation index at: https://sandrinodm.github.io/deckster/llms.txt
> Use this file to discover all available pages before exploring further.

# Slide frontmatter

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](https://sandrinodm.github.io/deckster/reference/layouts/).

## Keys

| Field | Type |
| --- | --- |
| `layout` | `string` |
| `title` | `string (non-empty)` |
| `surface` | `string` |
| `background` | `"none" \| string (non-empty) \| object` |
| `background.src` (required) | `string (non-empty)` |
| `background.fit` | `"cover" \| "contain"` |
| `background.focal` | `object` |
| `background.focal.x` (required) | `number (0 to 100)` |
| `background.focal.y` (required) | `number (0 to 100)` |
| `background.opacity` | `number (0 to 1)` |
| `background.tint` | `object` |
| `background.tint.role` (required) | `"bg" \| "surface" \| "fg" \| "accent"` |
| `background.tint.opacity` (required) | `number (0 to 1)` |
| `background.layers` | `"replace" \| "over"` |
| `budget` | `string` |
| `transition` | `"none" \| "fade" \| "slide" \| "rise" \| "push" \| "cover" \| "wipe" \| "zoom"` |
| `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](https://sandrinodm.github.io/deckster/reference/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](https://sandrinodm.github.io/deckster/concepts/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](https://sandrinodm.github.io/deckster/write-slides/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](https://sandrinodm.github.io/deckster/write-slides/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](https://sandrinodm.github.io/deckster/write-slides/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](https://sandrinodm.github.io/deckster/write-slides/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](https://sandrinodm.github.io/deckster/write-slides/mdx-slides/).

```mdx
---
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:

```tsx
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](https://sandrinodm.github.io/deckster/write-slides/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:

```console
$ 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.
```

Source: https://sandrinodm.github.io/deckster/reference/slide-frontmatter/index.mdx
