Layout

On this page

Every kit page has the same frame: a full-width .ph-page, a header with the title and actions, then content in cards. Grids, rows and stacks arrange the content and collapse on small screens.

Page and page header

Page header with breadcrumbs, actions and a calloutPage header with breadcrumbs, actions and a callout

Figure 1: A page header with breadcrumbs, a description and actions, followed by a callout and the content

<main class="ph-page">
  <nav class="ph-breadcrumbs" aria-label="Breadcrumb">
    <a href="./">Clinics</a>
    <a href="./">Ormsby Point</a>
    <span aria-current="page">Patients</span>
  </nav>
  <header class="ph-page-header">
    <div>
      <h1 class="ph-page-title">Patients</h1>
      <p class="ph-page-description">128 patients at Ormsby Point</p>
    </div>
    <div class="ph-page-actions">
      <button type="button" class="ph-btn">Export CSV</button>
      <button type="button" class="ph-btn ph-btn--primary">Add patient</button>
    </div>
  </header>
  <!-- callouts, then cards: sections are 16px apart automatically -->
</main>
ClassWhat it does
.ph-pageThe page: full width, 24px padding (16px on phones), 16px between sections
.ph-page--narrowCaps the page at 760px, centred. Only for settings forms and wizards.
.ph-page-headerTitle block on the left, actions on the right; wraps on small screens
.ph-page-titleThe page's one h1
.ph-page-descriptionOne line under the title: what the page shows, a count or a period
.ph-page-actionsThe page's buttons. The primary action goes last (rightmost).

Full width by default

Pages fill the window so dashboards, lists, reports and tools use wide screens. Don't wrap content in your own max-width container: put more side by side on wide screens instead. Use .ph-page--narrow only for settings forms and wizards, where long lines are hard to read. .ph-page--wide still works but does nothing extra: full width is already the default.

Grids

Grid layoutsGrid layouts

Figure 2: Two, three and four column grids, a spanning item, and a split view

<section class="ph-grid-4" aria-label="Key figures">
  <div id="kpi-arrivals"></div>
  <div id="kpi-cancelled"></div>
  <div id="kpi-revenue"></div>
  <div id="kpi-new"></div>
</section>
ClassColumns
.ph-gridAs many columns of 260px or more as fit. Tiles and cards fill wide screens.
.ph-grid-21 column, then 2 from 640px
.ph-grid-31 column, 2 from 640px, 3 from 1024px
.ph-grid-41 column, 2 from 640px, 4 from 1024px
.ph-span-2Makes an item span two columns (one on phones)
.ph-splitA 220px side column and a main column from 900px; stacked below that

Grid gaps are 16px. Put the side column first inside .ph-split.

Rows, stacks and spacers

Row variantsRow variants

Figure 3: A plain row, a row with space between, a right-aligned row, and a spacer

<div class="ph-row ph-row--end">
  <button type="button" class="ph-btn ph-btn--ghost">Cancel</button>
  <button type="button" class="ph-btn ph-btn--primary">Save</button>
</div>
ClassWhat it does
.ph-rowLays items out in a row, 8px apart, wrapping when they don't fit
.ph-row--betweenPushes the first and last items to the edges
.ph-row--endAligns items to the right (form and dialog buttons)
.ph-row--nowrapKeeps items on one line
.ph-spacerTakes up the free space, pushing what follows to the right
.ph-stackStacks items vertically, 16px apart
.ph-stack--sm / .ph-stack--lg8px / 24px apart

Text helpers

ClassWhat it does
.ph-section-titleA heading inside a card or between groups (15px, semibold)
.ph-mutedSecondary text colour
.ph-text-sm / .ph-text-xs13px / 12px text
.ph-text-success / .ph-text-warning / .ph-text-dangerStatus text colours
.ph-numTabular figures, so numbers line up
.ph-truncateOne line with an ellipsis
.ph-visually-hiddenHidden on screen but read by screen readers
.ph-no-printLeft out when the page is printed

Responsive behaviour

  • Grids collapse to one column on phones; .ph-split stacks below 900px.
  • Tables scroll inside .ph-table-wrap instead of widening the page.
  • Pages should work from 360px wide with no sideways scrolling.

Guidelines

  • One h1 per page (.ph-page-title). Card titles are h2.
  • The primary action is the rightmost button in the header, and the only primary button in view.
  • Show breadcrumbs only on pages below the first level.
  • Put page-level notices and errors in a callout straight after the header.