Layout Direction¶
Control how the code editor and output preview are arranged using the layout attribute.
Vertical layout¶
Code above, output below. This is the default for editor mode.
Horizontal layout¶
Code and output side by side. This is the default for playground mode.
Auto layout (responsive)¶
layout="auto" switches between horizontal on wide viewports and vertical on narrow viewports (≤768px). This is the default for playground mode.
Try resizing your browser window below 768px to see the layout switch from side-by-side to stacked.
Overriding defaults¶
You can override the default layout for any mode:
Fence syntax¶
```{.panel mode="editor" layout="vertical"}
# vertical: code above, output below (editor default)
```
```{.panel mode="playground" layout="auto"}
# auto: horizontal on wide screens, vertical on narrow (playground default)
```
Mode defaults¶
| Mode | Default Layout |
|---|---|
app |
N/A (output only) |
editor |
vertical |
playground |
auto |