Skip to content
Greg Bowler edited this page May 11, 2026 · 4 revisions

Partials are reusable HTML fragments that can be inserted into page views. They are a layout tool rather than a data-binding tool.

Unlike headers and footers, partials are not automatically applied to every page in a directory. Unlike custom HTML components, they are not intended to behave like named UI elements with their own focused element boundary. They are mainly for composing page structure from reusable pieces.

Why use partials?

Partials help when repeated sections of markup would otherwise be copied between several pages. They also help keep large page views manageable, especially when several pages share a common skeleton but differ in content.

In other words, they are useful for layout composition.

Partial file structure

Partial files live in the configured partial directory, which by default is page/_partial.

A page view can reference or extend partial content from there, allowing one file to provide the main layout while another fills in the page-specific parts. WebEngine expands those partials before the normal page binding and logic work is complete.

This means the final document shape is assembled first, and then the page logic can bind data into that assembled document.

When to use partials

Partials are a good fit for:

  • shared page sections that are not global enough to be headers or footers
  • layout fragments reused across one area of the application
  • page skeletons that several views build upon

Use headers and footers when the framing is global or directory-wide. Use custom components when the repeated fragment behaves more like a reusable UI element. Use ordinary binding when the structure is fixed and only the values change.

Partials help shape the document before data is bound into it. That is why this page is about layout composition, not data binding.


The content within page views can be made dynamic by binding data to the DOM.

Clone this wiki locally