09Components

Parts that behave.

The pieces this site is built from, with every state and the code to copy. Use the state switch to see hover, focus, pressed and disabled on everything at once. They work with a keyboard, a screen reader and one thumb.

Get the code ↓
Show every part as
02 · Buttons

Hover and a space opens.

Yellow for the one main action on a screen, ink for strong secondary actions, outline for the rest. At least 48 px tall. Click the second row to see busy and done.

<a class="btn btn-hl" href="…">Take part <span class="c">→</span></a>
<button class="btn btn-ink">Read <span class="c">↓</span></button>
<button class="btn btn-line btn-s">Small</button>

// busy: aria-busy="true" · done: .is-done
// disabled: the disabled attribute, never colour alone
03 · Choices

For choices, not for actions.

Choices always announce their state (aria-pressed, aria-selected, checked), so it is never shown by colour alone.

Tag

Make room.

<div role="group" aria-label="Language">
  <button class="pill" aria-pressed="true">English</button>
</div>
<div class="segc" role="group">…buttons…</div>
<div class="tabs" data-tabs>
  <div role="tablist"><button role="tab"
    aria-controls="p1">…</button></div>
  <div role="tabpanel" id="p1">…</div>
</div>
<label class="sw"><input type="checkbox"><i></i>Quiet</label>
04 · Form fields

Labels above, errors in words.

Every field has a visible label. Errors say what to do, never rely on red alone, and we only ask for what we need. Type in the first field to see it validate.

Only for the newsletter. Unsubscribe anytime.
✕ Add an @ and a domain, like ada@example.org.
Thanks, check your inbox.
<div class="fld err">
  <label for="email">Email</label>
  <input id="email" type="email" aria-invalid="true"
         aria-describedby="email-help">
  <span class="help" id="email-help">
    Add an @ and a domain.</span>
</div>
05 · Feedback

Say what happened, in words.

Success is verdigris, errors are vermilion, notices get the yellow space. Always with an icon and a sentence.

✓

Sent. We’ll reply within two working days.

i

Office closed 24–26 December. Replies resume on the 29th.

How are donations used?

Every contribution is reported with what it paid for. [Link to the report]

Who can apply?

Criteria are published with each call.

<div class="alert ok" role="status">
  <span class="ic">✓</span><p><b>Sent.</b> …</p>
</div>
PFF.toast("Copied to clipboard");
PFF.nudge("id", "Hold the name. The space grows.");
<div class="acc"><details><summary>…</summary>…</details></div>
06 · Navigation and cards

Always know where you are.

Links stay underlined. The breadcrumb names the section you are reading and offers a way back. Cards are one link each.

<nav class="crumbs" aria-label="Breadcrumb">
  <a class="back" data-back href="index.html">← Back</a>
  <ol><li><a href="index.html">Brand system</a></li>
      <li><a aria-current="page">09 Components</a></li></ol>
</nav>  // built into every page by tools/build.py
07 · Exit this page

For pages people may need to leave fast.

On support and reporting pages only. Always visible, bottom right. It replaces the page in the history, so Back doesn’t return here. Esc three times does the same. This demo goes nowhere.

or press Esc three times
<a class="exit on" href="https://www.bbc.com/weather"
   rel="noreferrer" referrerpolicy="no-referrer">Exit this page</a>
// site.js: location.replace() on click or Esc ×3
08 · Every component

Five promises.

⇥KeyboardReachable with Tab, a visible ultraviolet focus ring, Esc closes things.
AaContrast4.5:1 for text, 3:1 for large text and icons. Check it.
☝TouchTargets at least 44 × 44 px. Every hover has a tap or focus twin.
◐MotionRespects reduced motion and Quiet mode.
UKLanguageUkrainian blocks carry lang="uk" so screen readers switch voice.