domestic-ui GitHub

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:

  1. Problem: what authors cannot do well today.
  2. Use cases: concrete situations.
  3. Goals and 4. Non-goals. Goals name the design principles the pattern serves.
  4. Proposed markup and API: the attribute, element or methods we ship, with an example.
  5. Keyboard interaction.
  6. Accessibility mappings: roles, states, and what assistive technology users should hear.
  7. Alternatives considered, each with why it was rejected.
  8. Prior art, with links. We cite. We do not copy.
  9. 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.
  10. 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

ExplainerSummaryCSSExampleScript
CardA self-contained summary with a heading, optional media and actions; a whole-card link whose name is the headingcard.cssCardNone
PaginationLinks between pages of a list in a named <nav>, with aria-current="page" and non-link disabled endspagination.cssPaginationNone
DrawerA <dialog> variant at the inline-start or inline-end edge, full block sizedialog.cssDialog and drawerNone
ToastA fixed role="status" region that stacks short messages that never dismiss themselvesalerts.cssAlertsdui-toaster.js
ComboboxHow domestic-ui maps the APG list autocomplete combobox onto <input list> and <datalist>, and the choices the APG leaves opencombobox.cssTypeaheaddui-combobox.js
Densitydata-density="compact" on any element: tighter control heights, padding and table cells, same text size, targets at least 24pxsemantic.cssCompact densityNone
App shelldata-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 navigationapp-shell.cssApp shelldui-app-shell.js
Auxiliary sidebarThe <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 changeapp-shell.cssApp shelldui-app-shell.js
Split viewTwo 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 dividersplit.css, list-detail.cssSplitNone
Search dialogA 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 shortcutdialog.css, combobox.cssSearch dialogdui-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 backgroundtypography.cssBase elementsNone (the page registers ranges)

Search