Page header
The top of a page: breadcrumb, back link, the title (the page's h1),
status beside it, a description, actions, and tabs on its foot.
Anatomy
div[data-ds-page-header].@container/header sticky? bordered?
├── div breadcrumb slot
├── a ← backLabel backHref only
├── div flex-col; @2xl: row, space-between
│ ├── div
│ │ ├── h1|h2|h3 (truncate? title=…) · div meta slot
│ │ └── div description
│ └── div actions
│ ├── div secondary as ds::button secondary @max-xl: hidden with collapseActions, where scripts run
│ ├── ds::dropdown More (ds::dropdown-item each) @xl: hidden; collapseActions only; hidden with scripting off
│ └── actions slot
└── div tabs slot
Container queries on the header itself: actions go under the title below
42rem (@2xl), and secondary folds into More below 36rem (@xl). The
secondary actions are DATA (label, href or attributes, icon, tone)
because one action has to be drawn twice, as a button and as a menu item;
a slot of buttons cannot become menu items. With scripting off the
fold never happens ([@media(scripting:…)]), since the More menu cannot
open without Alpine. Values in attributes are
escaped before they go into the bag.
Heading sizes follow the type scale: h1 is text-heading (every page
title), h2 text-title, h3 text-section.
States
| Truncated | one line, ellipsis, the full title in title and in the heading's text |
| Sticky | sticky top-(--ds-sticky-offset,0px), opaque on surface-sunken, the app's ground. stickyOffset (a length; anything else throws) sets the variable on the header; a shell sets it for every page |
| With tabs | no border of its own; the tab row draws the rule |
Accessibility
| Role | a heading of the given level; the breadcrumb's nav; the tabs' own pattern |
| Name | the title |
| Keyboard | Tab through back link, breadcrumb, actions, More, tabs |
| Focus | each control's own ring |
Do not
- Do not render two
h1s on a page; give a section's headeras="h2". - Do not put foldable actions in the slot: only
secondaryfolds. - Do not pass class strings in
secondary:toneandicononly.
From the package repo: edit this page on GitHub.