# Template (/docs/components/template)

> Each kind of page is a Template: a Page names one of seven in its template field, and the Template says which Section types it carries.

> A Template is reusable Content with variables, filled from Things in the graph and authored as MDX, rendering a Message, Document, or Page.
>
> startupbuilder.dev, [Template](https://startupbuilder.dev/business/nouns/template)

In mdxui, each kind of page is a Template, and a Page names its kind in `template`. A set of packages styled for one look is a template package, never a Template.

## What mdxui renders

The seven Templates, each drawn from a worked Site that uses it. Open one for its Section types in order and a starter record.

| `template` | The page | Section types it carries |
| --- | --- | --- |
| `api-product` | A product landing | `nav`, `hero`, the feature and code types, `pricing`, `faq`, `closing`, `footer` |
| `article` | A reading page, a 404 or terms | `article` |
| `blog` | A blog index | `post-list` |
| `post` | One post | `page-head`, `article` |
| `contact` | A contact page | `cta-form` |
| `directory-list` | A directory of products | `product-list` |
| `directory-product` | One product in a directory | `product-head`, `facts`, `pricing` |

The two directory kinds wear the `directory` Theme: monochrome, one typeface, a tool rather than a landing.

## How it maps

  - **rendering a Page** (alpha): `template`, one of seven page kinds
  - **places Components** (spec): Slots: which Section type fills each, in order, and how many
  - **variables** (gap): None: the agent writes every value into the record
  - **authored as MDX** (gap): Authored as JSON, so a page parses or is refused
  - **rendering a Message** (spec): The [Email](https://next.mdxui.dev/docs/components/renderings/email) rendering
  - **rendering a Document** (gap): No Document rendering

## Status

`PageSchema` accepts the seven ids and checks no slot: a `blog` page that holds a `pricing` section parses.

**Spec · slot rules.**

A Template states its slots in page order: the Section types that may fill each, whether it is required, and its count. A page that breaks a slot rule is refused at its path, as a field past its bound is. The rules are not in `@mdxui/site@7.0.0-alpha.0`.

## Intended Noun

```yaml title="intended Noun: Template slots (mdxui.dev namespace)"
noun: Template slots
projects: startupbuilder.dev Template, quoted above; the page kinds only
fields:
  id: { type: enum, values: [api-product, article, blog, post, contact, directory-list, directory-product], required: true }
  slots:
    type: list of Slot, in page order, required: true
    Slot:
      name: { type: string, max: 32, required: true, example: how it works }
      fills: { type: list of Section type, count: 1 or more, required: true }
      required: { type: boolean, required: true }
      count: { type: integer range, example: exactly 4 }
  rules: { type: list of cross-slot rules, example: at least one section shows code }
example: api-product
  slots: nav, hero with an action, how it works, compare?, product, integration?, provenance?, confidence?, developers?, pricing?, faq, closing with actions, footer with a For agents column
```

## Related

  - [Templates](https://next.mdxui.dev/docs/showcase/templates): Each one live, with a starter record.
  - [Page](https://next.mdxui.dev/docs/components/page): The record that names a Template.
  - [Renderings](https://next.mdxui.dev/docs/components/renderings): One record, every output format.

