Layout styling reference
On this page
A layout is how a screen arranges a set of cards or tiles: a grid, a vertical list, one or two scrolling rows, a fixed grid of rows and columns, or columns of uneven cards. A layout holds whatever the screen puts in it. Follow the POS styling API rules when styling it.
Where it appears
The products, customers, orders, and other records a layout shows as cards, the tiles of an
action grid, the results of a quick search, and the stations and tickets of fulfillment. The
choice of grid, list, or rows comes from the layout’s settings, and data-variant says which
it is.
Parts
| Part | What it is | Available from |
|---|---|---|
layout-root |
The whole layout: the cells it arranges, the space between them, and the fill and corners of a list. | v22.0.8 |
The Available from column shows the first release that carries the name.
Attributes
Narrow layout-root by this, inside :where(), to style one kind of layout.
| Attribute | Values | Default | Available from |
|---|---|---|---|
data-variant |
list, rail, double-rail, grid, quick-grid, flex-grid |
grid |
v22.0.8 |
list— a vertical list, centered once it reaches the widest it growsrailanddouble-rail— one or two rows that scroll sidewaysgrid— as many columns as fit, scrolling downquick-grid— a fixed number of rows and columns that never scrollsflex-grid— columns of cards of uneven heights
Component properties
Set these on layout-root to change every layout, or narrow by data-variant to change one
kind. Where a layout’s settings choose a cell size or a count of rows or columns, the settings
win, so a store’s value changes the layouts whose settings leave it unset. A layout drawn small
inside a card, such as the ticket preview on a station card, keeps the sizes, gap, and number of
columns it is drawn at, whatever a store sets.
| Property | What it sets | Default | Available from |
|---|---|---|---|
--sc-layout-gap |
The space between the cells. | 4px | v22.0.8 |
--sc-layout-padding |
The space inside the edges. A list falls back to 8px. | 0 | v22.0.8 |
--sc-layout-radius |
The corners. A list keeps its own, so round one with border-radius on the part. |
0 | v22.0.8 |
--sc-layout-bg-color |
The fill. A list keeps its own, so fill one with background-color on the part. |
transparent | v22.0.8 |
--sc-layout-item-width |
The width of each cell in a rail or a double rail. | 340px | v22.0.8 |
--sc-layout-item-min-height |
The least height of each cell in a rail. | 40% | v22.0.8 |
--sc-layout-item-min-width |
The narrowest a cell in a grid gets. The grid fits as many columns of it as it can. | 220px | v22.0.8 |
--sc-layout-column-width |
The width a flex grid’s columns aim for. | 260px | v22.0.8 |
--sc-layout-rows |
The number of rows in a quick grid. | 1 | v22.0.8 |
--sc-layout-columns |
The number of columns in a quick grid, and the most a flex grid shows. Unset, a flex grid shows as many as fit. | 1 | v22.0.8 |
--sc-layout-list-max-width |
The widest a list layout grows. It stays centered beyond it. | 1000px | v22.0.8 |
Examples
Each example is tested against the POS on every change.
“Make the lists narrower.”
```css
–sc-layout-list-max-width: 800px; } ```
“Give the lists a white fill and squarer corners.”
```css
background-color: #ffffff; border-radius: 8px; } ```
“Space the cards in a grid further apart.”
```css
–sc-layout-gap: 12px; } ```
“Make the cards in a rail narrower.”
```css
–sc-layout-item-width: 280px; } ```
“Tint the space around the cards in a grid.”
```css
background-color: #f5f7fa; } ```
What can’t be styled yet
- The cell sizes and counts of rows and columns that a layout’s settings choose, which win over a store’s
- The sizes and gap of a layout drawn small inside a card, which the card chooses
Retired
None yet.
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.