domestic-ui GitHub

Organisms

Larger sections of an interface built from molecules and atoms. A level of Atomic Design; APIs follow the component API convention.

Pages

  • Page header: The top of a screen: an optional breadcrumb, the title, a description and actions that sit beside the title when there is room and wrap under it when not. API: data-page-header on a <header> inside <main>: optional breadcrumb <nav>, heading, optional <p>, actions last.
  • Dialog and drawer: A modal <dialog>, either centered or as a drawer along one edge of the viewport.
  • Site navigation: The main links of a site in a <nav> landmark, with the current page marked.
  • Data table: Rows of records in a native <table> with a caption, header cells and optional sorting.
  • Filter bar: A row of native form controls that narrows a list or table.
  • Large forms: Long forms split into labelled groups, in one or more columns.
  • Stat row: A row of headline numbers, each a small card with a label, the value and a note.

Our choices

From css/components/organisms/README.md:

  • Our choice: the page header takes its layout from its children's elements (a <nav> breadcrumb, a heading, a <p>, and a last child of actions) rather than extra attributes, so it is the markup any page already writes; <header> inside <main> is not the banner landmark.
  • Our choice: the filter bar is a plain <form method="get"> in <search> with an Apply button, so the filters live in the URL, work with JavaScript off, and do not interrupt screen reader users while they set several; the result count is a role="status" element present from page load, so changes are announced.
  • Our choice: form sections are <section> elements with a <header> and one body, not fieldsets with legends, because a legend cannot be placed in a grid column and headed sections show up in the headings list; related controls are still grouped in a <fieldset> inside the body.
  • Our choice: the data table's sortable headers are plain text in the markup and <dui-table> turns them into buttons, so with JavaScript off there are no buttons that do nothing; following the APG Sortable Table example, aria-sort is on the sorted header only, the arrow is hidden from assistive technology and the caption gets a visually hidden hint once the buttons exist.
  • Our choice: the data table has hairline row separators and no zebra stripes; the row under the pointer gets the raised surface, and cells use the 14px interface size.
  • Our choice: a selected row is marked by its checked checkbox, a bar on its leading edge and a tint, never color alone; the count is a role="status" element in the page from load, and the bulk actions are disabled until a row is selected. The "select all" checkbox is added by the script, since it would do nothing without it.
  • Our choice: a sticky table header sticks to the nearest scroll container: put the table in data-scroll="block inline" (at most --dui-size-pane tall), or in no scroll container to stick to the viewport. In data-scroll="inline" alone it cannot stick.
  • Our choice: numeric columns are marked per cell (data-table-cell="number"), the same attribute as the table, because words on the table cannot target a column.
  • Our choice: every organism and layout switches with a container query on its own box, not a media query, because it sits in regions of any width (a split, an app shell's main area). Container query conditions cannot read custom properties, so each breakpoint is a length written in the file header.

Not shipped, and why

CandidateDecision
Filters that apply on every keystrokeNot built in. A page MAY apply on change, but the default is a submit button, so several filters can be set without interruptions and the form works without JavaScript.
A <fieldset> as the top-level form sectionNot used. A <legend> cannot be placed in a grid column; sections are headed <section> elements, with fieldsets for groups inside them.
App shell, sidebar navigationNot organisms. The app shell is a layout (app-shell.css, with <dui-app-shell>) and the sidebar navigation is the nav molecule (data-nav="vertical"); see app-shell.md.
Tree view for navigationNot used. An APG Tree View is for hierarchies users navigate as data; site navigation is disclosure groups and links.
Editable cells, arrow keys between cellsNot in the data table. Cells that are edited in place make the table an APG Grid, a different widget with its own keyboard model.
Announcing the new order after a sortNot done. As in the APG Sortable Table example, aria-sort on the header is the announcement; a caption hint says which headers sort.
Sorting several columns at once, resizing or hiding columnsNot built in. Cancel dui-table-sort and sort on the server for multi-column orders.

Search