Editor Shell — Composition Pattern

editor-shell cluster-namespaced

The canonical composition pattern for design-tool / code-editor / canvas surfaces — a toolbar, a leading navigator pane, a center canvas, an optional trailing inspector pane, and a statusbar. Built from cluster-namespaced bespoke children. The legacy raw-HTML form (raw <header> + <div data-editor-body> + <pane-ui data-left|data-right> + <div data-canvas> + raw <footer>) was retired in v0.4.0 per ADR-0024; new code uses the bespoke shape exclusively per ADR-0023.

Canonical hierarchy

For the full live demo + state-as-attribute documentation, see /site/components/editor-shell. This page is the pattern hub.

<editor-shell> <!-- Top toolbar — icon + heading + description + actions --> <editor-toolbar> <span slot="icon"><icon-ui name="layers"></icon-ui></span> <span slot="heading">Untitled.fig</span> <span slot="description">1920 × 1080</span> <span slot="action"> <button-ui text="Share" variant="ghost"></button-ui> <button-ui text="Run" variant="primary"></button-ui> </span> </editor-toolbar> <!-- Leading sidebar — layer tree / outline / file browser --> <editor-sidebar slot="leading" collapsible persist="structure"> <pane-ui side="leading" resizable size="sm"> <header>Layers</header> <section> <tree-ui>...</tree-ui> </section> </pane-ui> </editor-sidebar> <!-- Center canvas — the editing surface --> <editor-canvas> <editor-canvas-toolbar> <tabs-ui value="preview" variant="underline"> <tab-ui value="preview" text="Preview"></tab-ui> <tab-ui value="schema" text="Schema"></tab-ui> </tabs-ui> </editor-canvas-toolbar> <editor-canvas-empty> <empty-state-ui icon="cursor" heading="Open a file to begin"></empty-state-ui> </editor-canvas-empty> <!-- canvas children: code editor, preview iframe, design surface, etc. --> </editor-canvas> <!-- Trailing sidebar (optional) — inspector / properties panel --> <editor-sidebar slot="trailing" collapsible persist="inspector"> <pane-ui side="trailing" resizable size="sm"> <header>Inspector</header> <section> <field-ui label="Width"><input-ui type="number"></input-ui></field-ui> <field-ui label="Height"><input-ui type="number"></input-ui></field-ui> </section> </pane-ui> </editor-sidebar> <!-- Bottom statusbar — connection / sync / cursor position --> <editor-statusbar> <span>Ready</span> <span data-spacer></span> <span>Ln 42, Col 8</span> </editor-statusbar> </editor-shell>

Part-by-part reference

PartRole
<editor-shell> Behavior-only host. Coordinates the family and propagates [focus-mode] to children's [full-screen] / [focused].
<editor-toolbar> Top band — slots: icon, heading, description, action.
<editor-sidebar> Leading (navigator) or trailing (inspector) pane. Holds <pane-ui>. Reflects [collapsed]; persist= wires localStorage.
<editor-canvas> Center surface. Holds optional <editor-canvas-toolbar> + <editor-canvas-empty> + canvas children. Reflects [empty].
<editor-statusbar> Bottom band — same slot vocabulary as toolbar; conventionally read-only.

Authoring rules

Where to next