Layout
Layout provides foundational patterns for responsive pages.
On this page
Description
Layout
provides foundational patterns for responsive pages.
Layout
can be used for simple two-column pages, or it can be nested to provide flexible 3-column experiences.
On smaller screens, Layout
uses vertically stacked rows to display content.
Layout
flows as both column, when there's enough horizontal space to render both Main
and Sidebar
side-by-side (on a desktop of tablet device, per instance);
or it flows as a row, when Main
and Sidebar
are stacked vertically (e.g. on a mobile device).
Layout
should always work in any screen size.
Accessibility
Keyboard navigation follows the markup order. Decide carefully how the focus order should be be by deciding whether
main
or sidebar
comes first in code. The code order won’t affect the visual position.
Arguments
Name | Type | Default | Description |
---|---|---|---|
stacking_breakpoint | Symbol |
| When the |
first_in_source | Symbol |
| Which element to render first in the HTML. This will change the keyboard navigation order. One of |
gutter | Symbol |
| The amount of space between the main section and the sidebar. One of |
system_arguments | Hash | N/A |
Examples
Slots
main
The layout's main content.
Name | Type | Default | Description |
---|---|---|---|
width | Symbol | N/A | One of |
system_arguments | Hash | N/A |
sidebar
The layout's sidebar.
Name | Type | Default | Description |
---|---|---|---|
width | Symbol | N/A | One of |
col_placement | Symbol | N/A | Sidebar placement when |
row_placement | Symbol | N/A | Sidebar placement when |
system_arguments | Hash | N/A |
Layout::Sidebar
The layout's sidebar content.
Layout::Main
The layout's main content.
Arguments
Name | Type | Default | Description |
---|---|---|---|
width | Symbol |
| One of |
system_arguments | Hash | N/A |