# HTML (/docs/components/renderings/html)

> Parse, render each Section type, compose, then wrap: how one Page record becomes one HTML document with one stylesheet and no framework.

`renderPage(page, { theme })` runs four steps and returns one HTML string: a document with one `<style>` element and no framework.

## What it renders

Harbor's blog index, one `renderPage` call. Widen it, narrow it to 390, or pick another Theme: every frame is a file the build wrote.

The rendered page: https://next.mdxui.dev/sites/harbor/blog; its record: https://next.mdxui.dev/pages/harbor/blog.json

## Four steps

| Step | Export | Does |
| --- | --- | --- |
| 1 | `PageSchema.parse` | Accepts the record or refuses it, naming each field over its bound |
| 2 | `renderBlock` | Renders each section's Section type, with a render context for the Theme and the shell `surface` it sits on |
| 3 | `compose` | Wraps each section in its shell, derives every divider from its neighbors, and draws the frame |
| 4 | `document` | Wraps the body in the head lines, the Theme's typefaces and one stylesheet |

[Document and head](https://next.mdxui.dev/docs/components/renderings/document-and-head) runs the four steps by hand and gets `renderPage`'s output byte for byte.

## A string, not a server

`renderPage` returns a string, so a build writes it to a file, as [Ship a Site](https://next.mdxui.dev/docs/start/ship) does, and a Worker returns it per request. Neither needs a runtime of its own.

## Without a script

27 of 27 Section types render no `<script>` element, each measured with every optional field set.

| Mechanism | Section types |
| --- | --- |
| `<details>` | `faq` |
| radio inputs | `terminal` |
| `popover` | `product-list` |
| inline `onclick` | `hero`, `feature-split`, `bento`, `steps`, `command-row`, `agent-prompt`, `closing`, `article` |

Every inline handler is a button's `onclick` that writes text to the clipboard: a copy control, or the article's copy-link button.

## Related

  - [Document and head](https://next.mdxui.dev/docs/components/renderings/document-and-head): The four steps, run by hand.
  - [Embed](https://next.mdxui.dev/docs/components/renderings/embed): One section inside another page.
  - [Ship a Site](https://next.mdxui.dev/docs/start/ship): Every record, written to files.

