- iOS:
makeVerticallyLabeledIcon, makeHorizontallyLabeledIconin govuk-once/govuk-mobile-ios-app/Production/govuk_ios/Views/DVLA/VehicleSpecView.swift at 8f1fe5da - Android:
SpecificationsIconsin govuk-once/govuk-mobile-android-app/design/src/main/kotlin/uk/gov/govuk/design/ui/component/SpecificationsIcons.kt at f50fcd71 - Figma: none linked yet
- Material Symbols, the icons it draws
Labelled icon
Shows a short fact with an icon that says what kind of fact it is, such as a vehicle's year with a calendar, its fuel with a pump, or its colour with a palette.
GOV.UK app component
Icons
The app’s icons are SF Symbols, which may only be used on Apple’s platforms, so it draws Material Symbols instead. Give it any symbol’s name as its icon. The closest to the app’s are calendar_month for a year, local_gas_station for fuel and palette for colour.
Known differences from the app
- Material’s symbols sit higher on their line than SF’s, so a stacked labelled icon is a few points shorter than the app’s, and its labels line up across columns, where the app’s sit lower under taller symbols.
- The app switches from stacked to inline by itself when its items don’t fit side by side. Here, choose the layout.
Examples
Stacked
HTML
<govuk-app-labelled-icon icon="calendar_month" label="Year of manufacture: 2021">2021</govuk-app-labelled-icon>
Inline
HTML
<govuk-app-labelled-icon icon="local_gas_station" layout="inline" label="Fuel: Petrol">Petrol</govuk-app-labelled-icon>
A vehicle's year, fuel and colour, in summary columns
HTML
<govuk-app-summary-columns>
<govuk-app-summary-column>
<govuk-app-labelled-icon icon="calendar_month" label="Year of manufacture: 2021">2021</govuk-app-labelled-icon>
</govuk-app-summary-column>
<govuk-app-summary-column>
<govuk-app-labelled-icon icon="local_gas_station" label="Fuel: Petrol">Petrol</govuk-app-labelled-icon>
</govuk-app-summary-column>
<govuk-app-summary-column>
<govuk-app-labelled-icon icon="palette" label="Colour: Yellow">Yellow</govuk-app-labelled-icon>
</govuk-app-summary-column>
</govuk-app-summary-columns>
Inputs
| Attribute | Type | Default | Description |
|---|---|---|---|
icon |
string |
The name of a Material Symbol, such as calendar_month, local_gas_station or palette. | |
layout |
"stacked" | "inline" |
stacked |
stacked: the icon over its label, both centred, as the app shows them side by side. inline: the icon before its label, as the app shows them when they don't fit side by side. |
label |
string |
What screen readers hear in place of the label alone, when the label doesn't say what it's about, such as Year of manufacture: 2021. |
Content
The fact, a word or two, such as 2021, Petrol or Yellow.
Outputs
None.
Rules
- Keep the label to a word or two: stacked, it stays on one line.
- Pick an icon that says what kind of fact it is, not what it is: a calendar for a year, whatever the year.
- Give it a label for screen readers when the fact alone doesn't say what it's about, as 2021 doesn't.
- Put a few side by side in summary columns, as the app does a vehicle's year, fuel and colour.
When not to use it
| When | Use instead |
|---|---|
| For something with a deadline or a validity, such as a vehicle's tax | govuk-app-status |
| For a number that matters on its own, such as penalty points | govuk-app-count |
| For a fact that needs more than a word or two | govuk-app-grouped-list-row type="information" |
| For a vehicle's registration | govuk-app-number-plate size="small" |
The iOS, Android and Figma sources it was built from
Screenshots of the app's own component, to compare the examples with
iOS