domestic-ui GitHub

From a simple site to an ERP app

Each step builds on the last. Stop at any step. Statuses are as of this build.

Step 1: a plain content page

Link css/domestic.css and write semantic HTML. The base layer styles it with no classes. Arrange content with the layout primitives:

  • Action bar: A long form whose Save and Cancel buttons stay in a sticky bar at the bottom of the window, with scroll margins so the bar never hides the focused field (WCAG 2.4.11).
  • Cluster: An inline group that wraps onto new lines (buttons, tags, nav links).
  • Grid: A responsive grid: as many columns as fit, each at least --grid-min wide, never wider than the container.
  • Page: A page that is not an app shell is laid out from its landmarks alone: the <header>, <nav>, <main> and <footer> that are children of <body> share one centered column, --dui-size-page wide at most, with an inline gutter so nothing touches the window edge.
  • Scroll: A scroll container for content wider than the screen, such as a data table, so it scrolls on its own instead of widening the page.
  • Stack: Vertical flow with a consistent gap between children.

Theme with semantic tokens.

Step 2: site navigation

  • Site navigation: The main links of a site in a <nav> landmark, with the current page marked.
  • Breadcrumb: The path to the current page: an ordered list of links in a labelled <nav>.
  • Search: A search form in a <search> landmark with an <input type="search">.
  • Pagination: Links to the pages of a long list of results.

All of these are available.

Step 3: interactive widgets

Use a native element where one exists, and an APG pattern where not:

  • Disclosure: A summary that shows or hides more content, built on <details> and <summary>.
  • Tabs: Sections of content shown one at a time, chosen from a list of tabs.
  • Dialog and drawer: A modal <dialog>, either centered or as a drawer along one edge of the viewport.
  • Popover: Content shown on top of the page from a button, with the popover attribute.
  • Menu button: A button that opens a menu of actions.
  • Toolbar: A row of related controls that is one stop in the tab order.
  • Typeahead: A text field that suggests values as you type: <datalist> first, an APG combobox where it falls short.
  • Alerts: Status messages, from notices in the page to live alerts and toasts.
  • Card: A self-contained item, such as an article teaser, on a raised surface.

All of these are available.

Step 4: the app shell

Frame the app with navigation and context sidebars, then lay out each screen:

  • App shell: The frame of an application: header, primary sidebar, main content and an optional auxiliary sidebar.
  • List-detail: A list of items beside the details of the selected one, stacked on narrow screens.
  • Split: Two regions side by side at a set ratio, stacked on narrow screens.
  • Dashboard: A grid of summary sections, each with a heading, that reflows to fit the screen.

All of these are available.

Step 5: data-heavy screens

Records in a native <table>, a filter bar, grouped forms and compact density:

  • 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.
  • Compact density: A compact density token that tightens spacing for data-heavy screens.

All of these are available.

Search