Skip to main content

These components are for prototyping the GOV.UK app, not for use in production.

<govuk-app-section>

Section

Groups part of a screen under a title, with a line saying what it's for if it needs one, and spaces it from what's above, so a long screen reads as a few clear parts: such as Check vehicle details, Status or Registered to.

GOV.UK app component

Known differences from the app

  • On its driving widget, the app puts Check vehicle details a little closer to the card above it, about 25pt. A section is always 32pt from what’s above it, as the app’s vehicle detail screen and the future driving designs space theirs.
  • Something beside the title, such as a number plate, is from the future driving designs, not the app.

Examples

With a description

Search for a vehicle Search for a vehicle

HTML

<govuk-app-section title="Check vehicle details" description="Tax and MOT information for any vehicle">
  <govuk-app-grouped-list>
    <govuk-app-grouped-list-row name="check-vehicle">Search for a vehicle</govuk-app-grouped-list-row>
  </govuk-app-grouped-list>
</govuk-app-section>

Something beside its title

LH09 PZ2 Tech specs LH09 PZ2 Tech specs

HTML

<govuk-app-section title="Overview">
  <govuk-app-number-plate slot="accessory">LH09 PZ2</govuk-app-number-plate>
  <govuk-app-grouped-list background="subtle">
    <govuk-app-grouped-list-row name="tech-specs">Tech specs</govuk-app-grouped-list-row>
  </govuk-app-grouped-list>
</govuk-app-section>

Sections one after another, on a screen

Tax 75 St John's Street Gateshead NE8 2ED Tax 75 St John's Street Gateshead NE8 2ED

HTML

<govuk-app-screen background="modal">
  <govuk-app-section title="Status">
    <govuk-app-grouped-list background="subtle">
      <govuk-app-grouped-list-row type="information" detail="Valid">Tax</govuk-app-grouped-list-row>
    </govuk-app-grouped-list>
  </govuk-app-section>
  <govuk-app-section title="Registered to">
    <govuk-app-address name="Mrs Jane Bloggs">
      75 St John's Street
      Gateshead
      NE8 2ED
    </govuk-app-address>
  </govuk-app-section>
</govuk-app-screen>

Inputs

Attributes
Attribute Type Default Description
title string Its title, such as Check vehicle details.
description string A line under the title saying what it's for, such as Tax and MOT information for any vehicle.
level "2" | "3" | "4" 2 The title's place in the screen's outline. Drawn as h2 to h4.

Content

What the section holds, such as a grouped list or an address, top to bottom, 16pt apart. Something with slot="accessory", such as a <govuk-app-number-plate>, goes on the right of its title.

Outputs

None.

Rules

  • Use sections to break a long screen into a few parts, each with a title that says what's in it.
  • Give it a description only when the title alone doesn't say what the section is for.
  • Put sections one after another in a screen: each is spaced from what's above it, as the app spaces its sections. The first on a screen isn't.
  • For a list with a title and nothing else, a grouped list's own title is enough.

When not to use it

When Use instead
For a list of rows that needs only a title govuk-app-grouped-list title="Privacy and legal"
For a section the user can act on as a whole, such as a widget with Edit govuk-app-section-heading
For the screen's own title govuk-app-heading level="1"
To put a few components side by side govuk-app-stack direction="horizontal"

Sources

The iOS, Android and Figma sources it was built from
  • iOS: VehicleCheckSectionView in govuk-once/govuk-mobile-ios-app/Production/govuk_ios/Views/DVLA/VehicleCheckSectionView.swift at 8f1fe5da
  • iOS: its section titles, such as Registered to in govuk-once/govuk-mobile-ios-app/Production/govuk_ios/Views/DVLA/VehicleDetailView.swift at 8f1fe5da
  • Figma: none linked yet

In the app

Screenshots of the app's own component, to compare the examples with

iOS

iOS app: Check vehicle details, with its description, in light mode
Check vehicle details, with its description, in light mode
iOS app: The same, in dark mode
The same, in dark mode
iOS app: Registered to, 32pt below what's above it
Registered to, 32pt below what's above it