Mode bar

The machine's five modes in one floating pill: Standby, Brew, Steam, Water, Grind. The machine's mode is the ink item.

HTML
<div class="bm-stage">
  <div class="bm-stack" style="width:366px"><span class="bm-eyebrow">At rest</span><nav class="bm-modebar" aria-label="Machine mode">
  <button class="bm-modebar__item" aria-pressed="false"><span data-icon="power" data-size="22"></span>Standby</button>
  <button class="bm-modebar__item" aria-pressed="true"><span data-icon="coffee" data-size="22"></span>Brew</button>
  <button class="bm-modebar__item" aria-pressed="false"><span data-icon="wind" data-size="22"></span>Steam</button>
  <button class="bm-modebar__item" aria-pressed="false"><span data-icon="droplet" data-size="22"></span>Water</button>
  <button class="bm-modebar__item" aria-pressed="false"><span data-icon="bean" data-size="22"></span>Grind</button>
</nav></div>
  <div class="bm-stack" style="width:366px"><span class="bm-eyebrow">While a shot runs</span><nav class="bm-modebar" aria-label="Machine mode">
  <button class="bm-modebar__item" aria-pressed="false" aria-disabled="true" aria-describedby="lock"><span data-icon="power" data-size="22"></span>Standby</button>
  <button class="bm-modebar__item" aria-pressed="true"><span data-icon="coffee" data-size="22"></span>Brew</button>
  <button class="bm-modebar__item" aria-pressed="false"><span data-icon="wind" data-size="22"></span>Steam</button>
  <button class="bm-modebar__item" aria-pressed="false" aria-disabled="true" aria-describedby="lock"><span data-icon="droplet" data-size="22"></span>Water</button>
  <button class="bm-modebar__item" aria-pressed="false" aria-disabled="true" aria-describedby="lock"><span data-icon="bean" data-size="22"></span>Grind</button>
</nav><p class="bm-help bm-modebar__note" id="lock">Locked while a shot runs. Steam stays available.</p></div>
  <div class="bm-stack" style="width:296px"><span class="bm-eyebrow">At 320 px</span><nav class="bm-modebar" aria-label="Machine mode">
  <button class="bm-modebar__item" aria-pressed="false"><span data-icon="power" data-size="22"></span>Standby</button>
  <button class="bm-modebar__item" aria-pressed="false"><span data-icon="coffee" data-size="22"></span>Brew</button>
  <button class="bm-modebar__item" aria-pressed="true"><span data-icon="wind" data-size="22"></span>Steam</button>
  <button class="bm-modebar__item" aria-pressed="false"><span data-icon="droplet" data-size="22"></span>Water</button>
  <button class="bm-modebar__item" aria-pressed="false"><span data-icon="bean" data-size="22"></span>Grind</button>
</nav></div>
  <div class="bm-stack" style="width:296px"><span class="bm-eyebrow">No grinder</span><nav class="bm-modebar" aria-label="Machine mode">
  <button class="bm-modebar__item" aria-pressed="true"><span data-icon="power" data-size="22"></span>Standby</button>
  <button class="bm-modebar__item" aria-pressed="false"><span data-icon="coffee" data-size="22"></span>Brew</button>
  <button class="bm-modebar__item" aria-pressed="false"><span data-icon="wind" data-size="22"></span>Steam</button>
  <button class="bm-modebar__item" aria-pressed="false"><span data-icon="droplet" data-size="22"></span>Water</button>
</nav></div>
  <div class="bm-stack" style="width:400px"><span class="bm-eyebrow">Desktop, 400 px</span><nav class="bm-modebar" aria-label="Machine mode">
  <button class="bm-modebar__item" aria-pressed="false"><span data-icon="power" data-size="22"></span>Standby</button>
  <button class="bm-modebar__item" aria-pressed="true"><span data-icon="coffee" data-size="22"></span>Brew</button>
  <button class="bm-modebar__item" aria-pressed="false"><span data-icon="wind" data-size="22"></span>Steam</button>
  <button class="bm-modebar__item" aria-pressed="false"><span data-icon="droplet" data-size="22"></span>Water</button>
  <button class="bm-modebar__item" aria-pressed="false"><span data-icon="bean" data-size="22"></span>Grind</button>
</nav></div>
</div>
  • It is state, not navigation: pressing a mode changes what the machine is doing. Pages are in the Nav.
  • It floats space-3 above the bottom edge and the safe area on a phone, and sits 400 px wide at the bottom centre on desktop. The page pads space-16 under its last tile so nothing hides behind it.
  • Exactly one set of mode controls shows at any size. The profile editor and Settings hide the mode bar and pin their own action instead.
  • Leave out Grind when there is no grinder; the four that remain share the width.

Anatomy

nav.bm-modebar: a surface-1 pill with a line hairline and space-1 of padding, holding one button.bm-modebar__item per mode. An item is 52 px tall and shares the width equally (54 px each on a 320 px screen), with a 22 px icon over its word in caption at weight 500.

States

StateFillIcon and word
Restnoneink-muted
Hover, pressedstate-hoverink
The machine's modeinkon-ink
Lockednoneink-faint
Focusthe focus ring

Locked is not faded. While a shot, a flush or a grind runs, every other mode except Steam is locked. A locked item keeps its place and its word, drawn in ink-faint at full opacity: 4.1:1 or better on the bar in both themes, where the old 40% opacity gave 1.9:1. Mark it aria-disabled="true", keep it focusable, and answer a press with a Toast: "Stop the shot to change mode." Steam never locks, because steaming milk during a shot is normal.

Content

Mode names are fixed and are never translated into verbs: Standby, Brew, Steam, Water, Grind. One word each, at most 7 characters.

Keyboard and screen reader

  • nav with aria-label="Machine mode". Items are buttons with aria-pressed; each is a Tab stop, in reading order.
  • A locked item has aria-disabled="true" and aria-describedby pointing at one visually hidden sentence: "Locked while a shot runs."
  • When the mode changes, from here or from the display, send the new mode to the status region ("Steam").