Shell

The header and menus, the phone menu, page head, footer, Display, banners, alerts and the command palette.

Phone header and menu

On phones the header is the menu button, the name and Display. The ☰ menu slides from the left with search, the main menu and the 1st level. The 2nd level stays under the header and scrolls sideways.

Press the menu button to open the drawer.

Behaviour

  • Focus moves to Close; Tab stays inside; Escape, Close or a press outside closes it and focus returns to the menu button.
  • The section you are in starts open. Choosing a page closes the menu.
  • Only the main menu and the 1st level have icons in the drawer.

Classes

  • .phone-menu, .phone-menu__search, .phone-menu__section, .phone-menu__foot, .panel-header

Display button

The same button and slide-out in every app: the last item in the header, on every page, Sign in and Set up included. It opens Display and accessibility.

The button

  • .icon-btn, the sun icon and the word Display. On phones the word is hidden from sight but still read out.
  • aria-haspopup="dialog" and aria-expanded.

The slide-out

  • Titled Display and accessibility; Close is named "Close display and accessibility".
  • In this order: Theme (Match device, Light, Dark), Text size (100% to 175%), Reduce motion (Match device, On, Off), High contrast, Underline links, Wider text spacing, Remove drop shadows (with its note; the library sets `data-shadows="off"` on the page and every shadow token becomes none, borders stay). An app adds its own after these (Starboard: Design).
  • Choices apply at once. Done and Reset in the foot.

Saving

  • To the person's account where the app has accounts; otherwise in the browser.
  • components.js applies the choices from data-display inputs. data-display-save="key" on the form keeps them in the browser; data-display-reset="key" on Reset.

Page banner

One message for the whole app, directly under the header, that stays while its state lasts: the connection to the server is lost, a restart is needed, or a restore makes the app read only. It goes when the state ends, not when it is closed.

Connection lost. Starboard is trying again every 10 seconds. Changes you make on this page are kept.

Restart needed. Starboard uses the new network settings after it restarts, in about 30 seconds.

Read only while a backup is restored. Changes can be saved again when it finishes.

When to use it

  • A state of the whole app that changes what people can do on every page: Connection lost, Restart needed, Read only.
  • One at a time; the most serious wins.

When not to

  • Anything about this page alone: use a notice in the page.
  • The result of an action: use a toast.
  • A restart of one app inside Starboard: keep the restart notice in its place (DASH-470).

Accessibility

  • pageBanner() says the words once: danger through role="alert", the rest politely. The banner itself is not a live region, so moving between pages does not repeat it.
  • It does not stick to the top, so it never covers what has focus (WCAG 2.4.11).
  • Words and an icon say the tone, never colour alone.

Classes and behaviour

  • .page-banner[data-tone], .page-banner__text, .page-banner__actions
  • SharedComponents.pageBanner(title, {{ text, tone, action }}) puts it after .site-header and returns the function that takes it away.

Popover and alerts centre

A popover is a small layer from a button for something to read and act on, without leaving the page. The alerts centre is built on it: Alerts in the header shows how many are unread, and opens the recent alerts with Mark as read on each and Mark all as read. The menu (.menu) stays for lists of actions only.

When to use it

  • A popover: a short list or a few facts from a button that people check and come back from, such as recent alerts.
  • The alerts centre: the newest 10 or so alerts, with All alerts linking to the page that keeps them.

When not to

  • Actions alone: use a menu. A task with fields: use a slide-out or a dialog. Help: use help links and a slide-out.
  • Anything that must be read before going on: use a dialog.

Accessibility

  • The button has aria-expanded and aria-controls; the popover is role="dialog", not modal, named by its heading.
  • Focus moves to the heading; Escape returns it to the button; a press outside or Tab out of it closes it.
  • The count is part of the button's name ("Alerts 3 unread"). Unread alerts have a dot, bold words and "Unread:" in hidden text. Marking says so politely and keeps focus on the alert.

Classes and behaviour

  • .popover-wrap, .popover[data-align], __head, __body, __body--flush, __foot; [data-popover] on the button.
  • .popover[data-alerts], .alerts, .alerts__item[data-unread][data-tone], __unread, __title, __time, __read, [data-alerts-read-all]; the alerts-read event.

Command palette

Find a page or an action by name and go there with Enter. It opens from its button, or with Ctrl and K (Command and K on a Mac). It is the combobox in a dialog. In this gallery it lists every section.

When to use it

  • An app with many pages and settings, as a quicker way for people who know what they want.
  • Next to search, never instead of the menus.

When not to

  • Searching content (books, films): use search.
  • The only way to reach something: everything in it is also in the menus or on a page.

Accessibility

  • The shortcut uses Ctrl or Command, so no single key starts it (WCAG 2.1.4); data-no-shortcut on <html> takes it away, for an app's setting.
  • Focus goes to the box and back to what had it when the dialog closes.
  • The number found is said politely, from inside the dialog so it is heard.

Classes and behaviour

  • [data-command-palette] on the button; [data-command] on any button it should list; .command-palette, .command-palette-open.
  • SharedComponents.commandPalette.items = () => [{{ label, hint, href | run }}] to list an app's own; otherwise it lists the side menu, menu tabs and phone menu links.