Scaffold
The scaffold lays out a header, scrollable body, and footer using named slots, for full pages or smaller sections alike.
Overview
The scaffold is a foundational layout component that provides structured slots for header, body, and footer content. This versatile structural tool offers named locations where you can render any element, making it suitable for full application layouts or nested within other scaffolds for complex interface hierarchies. The component handles positioning, spacing, and responsive behavior automatically, serving as the structural foundation for pages, dialogs, cards, and other container elements that need consistent layout organization.
Usage
forge-scaffold positions content through named slots — header, body, footer, left, right, and body-prefixed variants for a header/footer/left/right scoped to just the body — plus viewport to size itself to the full viewport height. Use it for a full page (typically app bar in header, a drawer in body-left, and page content in body), or to structure a smaller surface like a dialog or card with its own header, scrollable body, and footer.
Rules
Structure
Every slot at once shows how the scaffold positions content: left/right frame everything, header/footer pin above and below, and the body-prefixed slots do the same scoped to just the scrollable body.
Every scaffold slot filled in at once, to show how each one is positioned.
<forge-scaffold class="[--forge-scaffold-height:500px] [--forge-scaffold-width:100%]">
<div slot="left" class="border-2 border-dashed border-outline-low flex flex-col justify-center items-center p-xsmall m-xsmall box-border">
left
</div>
<div slot="header" class="border-2 border-dashed border-outline-low flex flex-col justify-center items-center p-xsmall m-xsmall box-border">
header
</div>
<div slot="body-header" class="border-2 border-dashed border-outline-low flex flex-col justify-center items-center p-xsmall m-xsmall box-border">
body-header
</div>
<div slot="body-left" class="border-2 border-dashed border-outline-low flex flex-col justify-center items-center p-xsmall m-xsmall box-border">
body-left
</div>
<div slot="body" class="border-2 border-dashed border-outline-low flex flex-col justify-center items-center p-xsmall m-xsmall box-border">
body
</div>
<div slot="body-right" class="border-2 border-dashed border-outline-low flex flex-col justify-center items-center p-xsmall m-xsmall box-border">
body-right
</div>
<div slot="body-footer" class="border-2 border-dashed border-outline-low flex flex-col justify-center items-center p-xsmall m-xsmall box-border">
body-footer
</div>
<div slot="footer" class="border-2 border-dashed border-outline-low flex flex-col justify-center items-center p-xsmall m-xsmall box-border">
footer
</div>
<div slot="right" class="border-2 border-dashed border-outline-low flex flex-col justify-center items-center p-xsmall m-xsmall box-border">
right
</div>
</forge-scaffold>Full page layout
Set viewport to size the scaffold to the full viewport height, with an app bar in header, a drawer in body-left, and page content in body.
A root-level, full-page scaffold also needs <body> styled to fill the window: load forge-core.css from @tylertech/forge/dist/forge-core.css, or set height: 100dvh; width: 100dvw; margin: 0; background-color: var(--forge-theme-surface-dim) yourself. Nested scaffolds in dialogs, cards, or panels need neither viewport nor these body styles.
An app bar, a drawer, and page content, laid out with a scaffold.
<forge-scaffold class="h-72">
<forge-app-bar slot="header" title-text="App" elevation="raised">
</forge-app-bar>
<forge-drawer slot="body-left" open>
<forge-list navlist>
<forge-list-item selected>
Overview
</forge-list-item>
<forge-list-item>
Settings
</forge-list-item>
</forge-list>
</forge-drawer>
<main slot="body" class="p-medium">
Page content
</main>
</forge-scaffold>The scaffold provides a generic layout structure for your content using common named areas. Use scaffolds for full page layouts or smaller sections within other elements where you want positioned content areas and scrollable body content.
import "@tylertech/forge/scaffold";| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
viewport | viewport | boolean | false | Whether the scaffold should be full viewport height. |
| Name | Description |
|---|---|
header | Places content in the header. |
body | Places content in the body. |
footer | Places content in the footer. |
left | Places content to the left of all content. |
right | Places content to the right of all content. |
body-header | Places content in the header of the body. |
body-footer | Places content in the footer of the body. |
body-left | Places content to the left of the body content. |
body-right | Places content to the right of the body content. |
| Name | Description |
|---|---|
::part(root) | The root container element. |
::part(header) | The header of the scaffold. |
::part(body) | The body of the scaffold. |
| Name | Description |
|---|---|
--forge-scaffold-height | The `height` of the scaffold. |
--forge-scaffold-width | The `width` of the scaffold. |
--forge-scaffold-overflow | The `overflow` of the scaffold. |
--forge-scaffold-body-position | The `position` of the scaffold body. |
No built-in semantics
The scaffold itself has no semantic meaning — it’s a layout tool, not a landmark. Provide your own semantic elements for slotted content, like <header>, <main>, and <aside>, since the scaffold makes no assumptions about what you put in it.
Keyboard reachability
Verify content in every slot stays reachable by tabbing — the scaffold only handles layout, not focus order.