BuilderLayout
BuilderLayout — the three columns of a builder: an outline of the parts on the left, the editor for the selected part in the centre, a live preview on the right. ```tsx <BuilderLayout outline={<QuestionList />} outlineLabel="Outline" editor={<QuestionEditor key={selectedId} />} preview={<LivePreview />} previewLabel="Preview" sticky /> ``` Responsive by container query, so it needs no knowledge of the page around it: all three columns from a 56rem container, wider side columns from 76rem, the preview under the editor below 56rem and everything stacked below 34rem (see `GRID` for each slot combination). The preview keeps its place in the tree when the editor or outline changes, so it never remounts; changing `previewLabel` between set and unset does remount it (the element changes from `<div>` to `<aside>`). It positions the three parts and nothing else. It does **not** own tabs, the app rail or a page header: those belong to the shell. Put a builder's sections in `useAppShellSubNav` (or your own tabs inside `editor`) and its title, status and actions in `AppShellPageHeader`. To keep one preview across sections, render one `BuilderLayout` around the sections and swap `editor`; nest a second one (outline and editor only) inside a section that has an outline.
packages/ui/src/components/layout/builder-layout.tsx
@marktiderman/genesis-ui/layoutimport { BuilderLayout } from "@marktiderman/genesis-ui/layout";react-docgen-typescript.BuilderLayout
BuilderLayout — the three columns of a builder: an outline of the parts on the left, the editor for the selected part in the centre, a live preview on the right. ```tsx <BuilderLayout outline={<QuestionList />} outlineLabel="Outline" editor={<QuestionEditor key={selectedId} />} preview={<LivePreview />} previewLabel="Preview" sticky /> ``` Responsive by container query, so it needs no knowledge of the page around it: all three columns from a 56rem container, wider side columns from 76rem, the preview under the editor below 56rem and everything stacked below 34rem (see `GRID` for each slot combination). The preview keeps its place in the tree when the editor or outline changes, so it never remounts; changing `previewLabel` between set and unset does remount it (the element changes from `<div>` to `<aside>`). It positions the three parts and nothing else. It does **not** own tabs, the app rail or a page header: those belong to the shell. Put a builder's sections in `useAppShellSubNav` (or your own tabs inside `editor`) and its title, status and actions in `AppShellPageHeader`. To keep one preview across sections, render one `BuilderLayout` around the sections and swap `editor`; nest a second one (outline and editor only) inside a section that has an outline.
| Prop | Type | Default | Description |
|---|---|---|---|
| editor* | ReactNode | — | Centre column: the editor for the selected thing. Required. |
| editorProps | BuilderLayoutSlotProps | — | Props for the editor's wrapper. |
| outline | ReactNode | — | Left column: the list of things being built (questions, lessons, steps). Optional. Rendered as a `<nav>` when `outlineLabel` is set. |
| outlineLabel | string | — | Accessible name for the outline; makes it a `navigation` landmark. |
| outlineProps | BuilderLayoutSlotProps | — | Props for the outline's wrapper (class, test id, data attributes). |
| preview | ReactNode | — | Right column: a live preview (and anything that sits with it, such as checks). Optional. Rendered as an `<aside>` when `previewLabel` is set. It keeps its place in the tree whatever `editor` and `outline` hold, so swapping the editor (another section, another selected item) never remounts it: the preview's own state (device, answers typed into it, scroll) survives. |
| previewHidden | boolean | false | Keep the preview mounted but hidden, and give its width back to the editor. For a section that needs the whole width (a host's own settings layout) without losing the preview's state. |
| previewLabel | string | — | Accessible name for the preview; makes it a `complementary` landmark. |
| previewProps | BuilderLayoutSlotProps | — | Props for the preview's wrapper. |
| scrollSticky | boolean | false | With `sticky`, cap each pinned column at the viewport height and let it scroll on its own, so a long outline or preview stays reachable. Default `false`. |
| sticky | boolean | { outline?: boolean; preview?: boolean; } | undefined | false | Pin the outline and/or the preview at the top while the editor scrolls, once each sits in a column of its own (not while stacked). `true` pins both. Default `false`. |