---
id: portfolio.ds.chat-page-template
name: "Chat Page Template"
type: template
status: active
relations: [{"type":"composes","target":"portfolio.ds.header"},{"type":"composes","target":"portfolio.ds.chat"},{"type":"related_to","target":"portfolio.ds.page-template"},{"type":"supersedes","target":"portfolio.ds.chat-page-template-old"}]
sources: ["packages/design-system/src/components/ChatPageTemplate.astro","apps/portfolio-site/src/design-system/docs/chat-page-template.astro","apps/portfolio-site/src/lib/designSystemRegistry.ts","apps/portfolio-site/src/components/routes/HomeRoute.astro"]
catalog: ["apps/portfolio-site/src/design-system/docs/chat-page-template.astro"]
previews: ["apps/portfolio-site/src/design-system/docs/chat-page-template.astro"]
---
# Chat Page Template

## Purpose
A viewport-height page with Header above Chat. There is no Footer. Chat fills the remaining height and scrolls internally; the page itself does not scroll.

## Contract
- Header receives the brand, locale, navigation labels and items from the caller. The optional `header-bottom` slot supplies its bottom row.
- The default body is Chat, configured by the `chat` prop. A caller can supply a Chat with its own adapter through the default slot instead.
- The template uses `100dvh` unless the chat supplies a keyboard-adjusted viewport height. Header follows the local chat scroll surface. When Header changes height, messages keep their reading position relative to the scroll distance and the composer stays at the bottom.

## Accessibility
On a page the content is the native `main` landmark. When embedded inside an existing main, pass `embedded` to use a neutral container with the same layout.

## Use
Use for a full-page conversation. In the catalog, the expandable Templates group below the separator contains Chat Page Template, with Chat nested beneath it. The ordinary example at `/design-system/chat-page-template/` uses the default Header and a local chat fixture. Its State control changes the fixture, not the template layout. An explicitly authenticated local host can attach a real adapter instead; it omits simulated states. This is a host choice, not a template prop or a second Chat.

## Do Not Use
For a document that scrolls as a whole or needs a Footer, use Page Template instead.

## Verification
Check that the homepage and catalog each have one main landmark. With a long conversation, scroll the messages and verify that the composer stays at the bottom and outer catalog scrolling does not move the embedded Header.
