Explainers
An explainer describes a pattern that has no native HTML element and no APG pattern, written the way a platform feature would be proposed. The format follows the W3C TAG explainer guidance and the explainers published by Open UI. Nothing here is a standard. Each file says which parts are Our choice and why.
When an explainer is required
domestic-ui uses, in order: a native element, then the matching APG pattern, then ARIA only where native HTML cannot express something (PRINCIPLES.md). A molecule that ends up with neither a native element nor an APG pattern MUST have an explainer here, linked from the header comment of its CSS file and from the molecules index. Layouts with no standard of their own (the split view, the app shell) may have one too. Patterns that are backed by a standard (dialog, details, popover, tabs, menu button, toolbar, breadcrumb, search) link to that standard instead.
Keywords
The key words MUST, MUST NOT, SHOULD, SHOULD NOT and MAY are to be interpreted as described in RFC 2119 and RFC 8174 when, and only when, they appear in all capitals.
Sections
Every explainer has these sections, in this order:
- Problem: what authors cannot do well today.
- Use cases: concrete situations.
- Goals and 4. Non-goals. Goals name the design principles the pattern serves.
- Proposed markup and API: the attribute, element or methods we ship, with an example.
- Keyboard interaction.
- Accessibility mappings: roles, states, and what assistive technology users should hear.
- Alternatives considered, each with why it was rejected.
- Prior art, with links. We cite. We do not copy.
- Mapping to a future standard: the nearest standards effort (an Open UI component, a WHATWG or CSSWG issue) or "none known", how our markup would map onto it, and what a page would rename if it shipped. Where an effort exists, our names follow it.
- Open questions.
Names follow HTML and ARIA conventions (lowercase, no abbreviations, states in native attributes) so a pattern could map onto a future native element or attribute.
Index
| Explainer | Summary | CSS | Example | Script |
|---|---|---|---|---|
| Card | A self-contained summary with a heading, optional media and actions; a whole-card link whose name is the heading | card.css | Card | None |
| Pagination | Links between pages of a list in a named <nav>, with aria-current="page" and non-link disabled ends | pagination.css | Pagination | None |
| Drawer | A <dialog> variant at the inline-start or inline-end edge, full block size | dialog.css | Dialog and drawer | None |
| Toast | A fixed role="status" region that stacks short messages that never dismiss themselves | alerts.css | Alerts | dui-toaster.js |
| Combobox | How domestic-ui maps the APG list autocomplete combobox onto <input list> and <datalist>, and the choices the APG leaves open | combobox.css | Typeahead | dui-combobox.js |
| Density | data-density="compact" on any element: tighter control heights, padding and table cells, same text size, targets at least 24px | semantic.css | Compact density | None |
| App shell | data-app-shell: app bar, primary sidebar, main and an auxiliary sidebar as native landmarks in named grid areas; one copy of each sidebar, collapsible beside main and a modal drawer when the shell is narrow; why not a dialog, popover, <details>, checkbox hack or duplicated navigation | app-shell.css | App shell | dui-app-shell.js |
| Auxiliary sidebar | The <aside> after <main> in an app shell: context for the selection, beside main from 64rem, a drawer at the end below; stable name, polite status on change | app-shell.css | App shell | dui-app-shell.js |
| Split view | Two regions side by side at a fixed ratio (data-split) or a list of links beside a detail pane (data-list-detail), switched by a container query; why there is no draggable divider | split.css, list-detail.css | Split | None |
| Search dialog | A command palette: a modal <dialog> holding a <dui-combobox> of pages and sections, opened from a Search button or with Cmd-K / Ctrl-K; when results load, how they map to options, and the shortcut | dialog.css, combobox.css | Search dialog | dui-combobox.js plus page script |
| Code highlighting | ::highlight(dui-code-*) names a page registers with the CSS Custom Highlight API, each colored by a --dui-color-code-* token at 4.5:1 on the code background | typography.css | Base elements | None (the page registers ranges) |