{}

Embedded pages: overview

BESPA gives you three ways to render one page inside another. They share the same mechanism — EmbedHandler invokes a handler against an in-memory response recorder, slices the resulting <body>, and drops it into a container widget. What differs is the container and the state contract around it.

Use this page to pick the right one. Each row links to its deep-dive.

At a glance

Mechanism Container Controlled by Visually Reach for it when
Inline embed GroupingFrame, any container A boolean-ish state key (HideIfEmpty) Part of document flow A sub-page belongs in-line — a detail strip, a settings block under a header
Modal Modal("key") One state key holding the embedded path Centered overlay, dims background A focused interaction that should pause the rest of the page
Side panel SidePanel("key") One state key holding the embedded path Sliding pane, doesn’t dim A contextual surface the user reads beside the main content
Named frame GroupingFrame(...).WithName("x") Links that set WithTarget("x") Multiple independent surfaces on one screen A dashboard, IDE-style split, or chat-and-thread layout — each pane navigates on its own

How they relate

All four are the same shape under the hood:

container.Add(wf.EmbedHandler(handler, r, "GET", path, nil))

What changes is the container widget and how path is decided:

State isolation is the same everywhere

Whichever mechanism you pick, the embedded page sees an isolated slice of state. A variable named x in the embed doesn’t collide with one of the same name in the parent. That’s what lets you compose pages without coordinating their state vocabularies.

Which one am I looking at?

A useful disambiguation when you’re reading example code:

Common traps

Deep dives