- iOS:
button, the vehicle search it looks likein govuk-once/govuk-mobile-ios-app/Production/govuk_ios/Views/DVLA/VehicleCheckSectionView.swift at 8f1fe5da - iOS:
RegistrationNumberField, where the app has the user type a registration todayin govuk-once/govuk-mobile-ios-app/Production/govuk_ios/Views/DVLA/RegistrationNumberField/RegistrationNumberField.swift at 8f1fe5da - Figma: none linked yet
Search box
Lets the user type what they're looking for where they are and search for it, on a card of its own with a search button, such as a vehicle's registration to check its tax and MOT. A hint of what to type, such as a blank number plate, can sit inside it.
GOV.UK app component Proposed
Warning
This isn’t in the app yet. It’s proposed, from a screenshot of the future driving designs in Figma, until there’s a link to the file, so it may change, or never ship. Don’t present it as part of the app today.
Known differences from the designs
- Its placeholder is grey, as iOS’s are. The designs draw Start in black, as the app’s vehicle search draws its label, which isn’t a box to type in.
- Its icon is Material Symbols’ search in place of SF’s magnifyingglass, which may only be used on Apple’s platforms.
Examples
A vehicle's registration, with a blank number plate
HTML
<govuk-app-section title="Check a vehicle" description="View information for any vehicle">
<govuk-app-search-box placeholder="Start" label="Registration number" name="registration" action="#vehicle">
<govuk-app-number-plate slot="accessory" variant="front">ABC</govuk-app-number-plate>
</govuk-app-search-box>
</govuk-app-section>
Without an accessory
HTML
<govuk-app-section title="Find your local council" description="Check which council looks after where you live">
<govuk-app-search-box placeholder="Postcode" name="postcode" action="#council"></govuk-app-search-box>
</govuk-app-section>
Inputs
| Attribute | Type | Default | Description |
|---|---|---|---|
placeholder |
string |
What the box shows until the user types, such as Start, as the designs have it, or Search for a vehicle. | |
label |
string |
The box's name for screen readers, such as Registration number. Without it, they hear its placeholder. | |
name |
string |
q |
The name what the user typed is sent as. |
value |
string |
Text already in the box. | |
action |
string |
Where the search goes, such as the page of results. Without it, the page it's on. |
Content
Optionally, an element with slot="accessory", inside the box after the text, hinting at what to type, such as <govuk-app-number-plate variant="front">ABC</govuk-app-number-plate>. Screen readers don't hear it.
Outputs
submit: From its form, when the user presses its search button or Search on the keyboard.input: From its box, as the user types.
Rules
- Put it in a section that says what it searches for, such as Check a vehicle, with a description, such as View information for any vehicle.
- Give it a label saying what to type, such as Registration number, when its placeholder doesn't: screen readers don't hear its accessory.
- Give it an accessory only where it shows what to type, as a blank number plate does for a registration.
- For a search bar in the system's style, such as at the top of a screen or a list, use the search field.
When not to use it
| When | Use instead |
|---|---|
| To search GOV.UK, or filter a list, such as of countries | govuk-app-search-field |
| To ask a question on a form, with a button below to carry on | govuk-app-text-field |
| To ask GOV.UK Chat | govuk-app-chat-input |
The iOS, Android and Figma sources it was built from
Screenshots of the app's own component, to compare the examples with
iOS