Skip to content

Commit 9e169d5

Browse files
committed
clarify service name
1 parent 38ae419 commit 9e169d5

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

docs/features/page-elements.mdx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,11 @@ When a page has validation errors, prefix the title with `"Error: "`. Screen rea
146146
**Properties:** `serviceUrl: string`, `name: string | undefined`
147147

148148
- `serviceUrl` is the root URL of the current form (e.g. `/my-form`). Use it as the service link in your header so users can return to the start of the form.
149-
- `name` is the form name from the form definition. Use it as the service name in your header.
149+
- `name` is the form name from the form definition.
150150

151-
The [GOV.UK Service navigation](https://design-system.service.gov.uk/components/service-navigation/) component is recommended for this from GOV.UK Frontend v5:
151+
The [GOV.UK Service navigation](https://design-system.service.gov.uk/components/service-navigation/) component is recommended for this from GOV.UK Frontend v5.
152+
153+
If your service hosts a single form and the form name is the service name, passing `name` as `serviceName` is appropriate:
152154

153155
```njk
154156
{% from "govuk/components/service-navigation/macro.njk" import govukServiceNavigation %}
@@ -159,6 +161,17 @@ The [GOV.UK Service navigation](https://design-system.service.gov.uk/components/
159161
}) }}
160162
```
161163

164+
If your service hosts multiple forms, `serviceName` should be your real service name rather than the individual form name. In that case, `name` is more suited as a page-level heading — for example, as an `<h1>` above the form content:
165+
166+
```njk
167+
{{ govukServiceNavigation({
168+
serviceName: "My Service",
169+
serviceUrl: "/"
170+
}) }}
171+
172+
<h1 class="govuk-heading-l">{{ name }}</h1>
173+
```
174+
162175
<div className="component-preview app-no-prose">
163176
<div dangerouslySetInnerHTML={{ __html: `<section aria-label="Service information"
164177
class="govuk-service-navigation"

0 commit comments

Comments
 (0)