Editor Advanced Block Components — 5 specialized blocks for power-user editing workflows: synced (reusable) blocks, multi-column layouts with drag-resize dividers, executable code sandboxes, A4 page containers, and page header/footer chrome.
These components enable document-level features found in advanced editors like Notion, Google Docs, and Overleaf.
All components render meaningful HTML without JavaScript (progressive enhancement) and support dark mode via Tailwind v4 design tokens.
Components
synced_block/1— reusable content reference with synced indicatorcolumns_block/1— multi-column layout with drag-resize dividerscode_sandbox_block/1— executable code editor with output areaa4_page/1— A4 page container with margins and page numberingpage_header_footer/1— header/footer bar for A4 page containers
Summary
Functions
Renders an A4 page container with margins, white background, shadow, and optional header/footer areas.
Renders an executable code block with a code editor textarea and an output display area.
Renders a multi-column layout with CSS grid and vertical dividers between columns.
Renders a header or footer bar for A4 page containers.
Renders a reusable content reference block with a "Synced" badge indicator.
Functions
Renders an A4 page container with margins, white background, shadow, and optional header/footer areas.
The container is styled for A4 dimensions (210mm x 297mm) at @media print.
On screen, it renders as a white page with shadow and padding approximating
standard margins (25.4mm). Page number is shown in the footer when provided.
Example
<.a4_page id="page-1" page_number={1}>
<:header>My Document</:header>
Page content goes here.
<:footer>Confidential</:footer>
</.a4_page>Attributes
id(:string) (required) - Unique identifier for the A4 page.page_number(:integer) - Page number (displayed in footer). Defaults tonil.show_header(:boolean) - Whether to render the header slot. Defaults totrue.show_footer(:boolean) - Whether to render the footer slot. Defaults totrue.class(:string) - Additional CSS classes. Defaults tonil.- Global attributes are accepted. Additional HTML attributes.
Slots
header- Optional header content for the page.inner_block(required) - Main page content.footer- Optional footer content for the page.
Renders an executable code block with a code editor textarea and an output display area.
The header shows the language label and a "Run" button that dispatches
phx-click="code-sandbox:run" with the block ID. The output area renders
in a monospace pre element with a muted background.
Example
<.code_sandbox_block
id="sandbox-1"
language="elixir"
code="IO.puts(:hello)"
output="hello"
/>Attributes
id(:string) (required) - Unique identifier for the code sandbox.language(:string) - Programming language label. Defaults to"javascript".code(:string) - Source code content. Defaults to"".output(:string) - Execution output text. Defaults to"".class(:string) - Additional CSS classes. Defaults tonil.
Renders a multi-column layout with CSS grid and vertical dividers between columns.
Each column has min-w-0 to prevent content overflow, and a vertical divider
with cursor-col-resize and hover highlight between columns. Columns are
indexed via data-column-index.
Example
<.columns_block id="two-col" columns={2}>
<:column>Left column content</:column>
<:column>Right column content</:column>
</.columns_block>Attributes
id(:string) (required) - Unique identifier for the columns block.columns(:integer) - Number of columns (1-4). Defaults to2.class(:string) - Additional CSS classes. Defaults tonil.- Global attributes are accepted. Additional HTML attributes.
Slots
column- Individual column content (repeatable slot).
Renders a reusable content reference block with a "Synced" badge indicator.
Synced blocks display the same content as the original source block. Changes to the source propagate to all synced instances. The block has a subtle dashed border to visually distinguish it from regular blocks.
Example
<.synced_block id="sync-1" source_id="original-block-42">
This content is synced from block 42.
</.synced_block>Attributes
id(:string) (required) - Unique identifier for the synced block instance.source_id(:string) (required) - ID of the original source block being referenced.class(:string) - Additional CSS classes. Defaults tonil.- Global attributes are accepted. Additional HTML attributes.
Slots
inner_block(required) - Block content (mirrors the source block).