Nav styling reference
On this page
POS users navigate the POS using menus in the top bar and the sidebar. The nav lays out list buttons in a rail or a row, and a group opens more items under the group’s button or in a menu over the page. Use this reference to style the nav, following the POS styling API rules.
Where the nav appears
The nav appears in two places:
- The top bar’s actions, always laid out as a row
- The sidebar, laid out as a rail, which becomes a row on a medium screen
Both places hold the same three things:
- The main list of action items
- The More button and the menu it opens
- The groups that open from an item
The sidebar also holds the pinned list, and the collapse button while the sidebar is a rail.
A rule on a row applies to both the top bar and the sidebar.
Parts of the nav
| Part | What it is | Available from |
|---|---|---|
nav-root |
The whole nav: the bar or the rail, holding the lists. | v22.0.14 |
nav-list |
A list of items in the nav, or the items a group opens under the group’s button. | v22.0.14 |
nav-item |
One entry in a list, holding an item or a group. | v22.0.14 |
nav-group |
A group of items: the button that opens it and, while open, the list or the menu under it. | v22.0.14 |
The Available from column shows the first release that carries the name.
Attributes of the nav
Narrow nav-root by these, inside :where(), to style a rail or a row.
| Attribute | Values | Default | Available from |
|---|---|---|---|
data-direction |
horizontal, vertical |
horizontal |
v22.0.14 |
data-align |
start, center, end |
start |
v22.0.14 |
horizontal— a row of items, as in the top bar and in the sidebar on a medium screenvertical— a rail, laid out in a column, as in the sidebar otherwisestart,center,end— where the lists sit along the nav
Component properties
The nav has none of its own. Style the parts directly, and the items and menus by their own properties.
Nav examples
Each example is tested against the POS on every change.
“Space the rail’s items further apart.”
```css
gap: 8px; } ```
“Tint every row of items.”
```css
background-color: #f1f5f9; padding: 4px; } ```
“Round the corners of the lists, such as the sidebar’s raised one.”
```css
[part~=’nav-list’] { border-radius: 12px; } ```
What can’t be styled yet
- The button that opens a group on its own: it is a list button with no name of its own yet
- Padding, a border, or a margin on
nav-item: the nav counts how many items fit by each item’s button, so room added around it isn’t counted, and items spill past the nav instead of moving to the More menu - The top bar’s row apart from the sidebar’s row on a medium screen
- A list that scrolls, or sits on a raised card, apart from the others
- The fill and corners of the list a group opens under the group’s button in the expanded sidebar, which the navigation sets on the list itself, so a rule on
nav-listdoesn’t reach them
Retired
None yet.
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.