-
Notifications
You must be signed in to change notification settings - Fork 365
Expand file tree
/
Copy pathheader.yaml
More file actions
368 lines (347 loc) · 11.5 KB
/
header.yaml
File metadata and controls
368 lines (347 loc) · 11.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
params:
- name: homepageUrl
type: string
required: false
description: The URL of the homepage. Defaults to `"/"`.
- name: productName
type: string
required: false
description: Product name, used when the product name follows on directly from ‘GOV.UK’. For example, GOV.UK Pay or GOV.UK Design System. In most circumstances, you should use `serviceName`.
- name: serviceName
type: string
required: false
description: The name of your service, included in the header.
deprecated: '5.9.0'
- name: serviceUrl
type: string
required: false
description: URL for the service name anchor.
deprecated: '5.9.0'
- name: navigation
type: array
required: false
description: Can be used to add navigation to the header component.
deprecated: '5.9.0'
params:
- name: text
type: string
required: true
description: Text for the navigation item. If `html` is provided, the `text` option will be ignored.
deprecated: '5.9.0'
- name: html
type: string
required: true
description: HTML for the navigation item. If `html` is provided, the `text` option will be ignored.
deprecated: '5.9.0'
- name: href
type: string
required: false
description: URL of the navigation item anchor.
deprecated: '5.9.0'
- name: active
type: boolean
required: false
description: Flag to mark the navigation item as active or not.
deprecated: '5.9.0'
- name: attributes
type: object
required: false
description: HTML attributes (for example data attributes) to add to the navigation item anchor.
deprecated: '5.9.0'
- name: navigationClasses
type: string
required: false
description: Classes for the navigation section of the header.
deprecated: '5.9.0'
- name: navigationLabel
type: string
required: false
description: Text for the `aria-label` attribute of the navigation. Defaults to the same value as `menuButtonText`.
deprecated: '5.9.0'
- name: menuButtonLabel
type: string
required: false
description: Text for the `aria-label` attribute of the button that opens the mobile navigation, if there is a mobile navigation menu.
deprecated: '5.9.0'
- name: menuButtonText
type: string
required: false
description: Text of the button that opens the mobile navigation menu, if there is a mobile navigation menu. There is no enforced character limit, but there is a limited display space so keep text as short as possible. By default, this is set to 'Menu'.
deprecated: '5.9.0'
- name: containerClasses
type: string
required: false
description: Classes for the container, useful if you want to make the header fixed width.
- name: classes
type: string
required: false
description: Classes to add to the header container.
- name: attributes
type: object
required: false
description: HTML attributes (for example data attributes) to add to the header container.
- name: useTudorCrown
type: boolean
required: false
description: If `true`, uses the Tudor crown from King Charles III's royal cypher. Otherwise, uses the St. Edward's crown. Default is `true`.
deprecated: '5.2.0'
- name: rebrand
type: boolean
required: false
description: If `true`, use the redesigned header and new GOV.UK logotype. Default is `false`.
previewLayout: full-width
accessibilityCriteria: |
Text and links in the Header must:
- have a text contrast ratio higher than 4.5:1 against the background colour to meet [WCAG AA](https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast)
Links in the Header must:
- accept focus
- be focusable with a keyboard
- be usable with a keyboard
- indicate when they have focus
- change in appearance when touched (in the touch-down state)
- change in appearance when hovered
- have visible text
Images in the Header must:
- be presentational when linked to from accompanying text (crown icon).
Landmarks and Roles in the Header should:
- have a role of `"banner"` at the root of the component (<header>) (https://www.w3.org/TR/wai-aria-1.1/#banner)
examples:
- name: default
screenshot:
variants:
- default
- no-js
description: The standard header as used on information pages on GOV.UK
options: {}
- name: with service name
description: If your service is more than a few pages long, you can help users understand where they are by adding the service name.
options:
serviceName: Service Name
serviceUrl: '/components/header'
- name: with service name but no service url
options:
serviceName: Service Name
- name: with navigation
options:
navigation:
- href: '#1'
text: Navigation item 1
active: true
- href: '#2'
text: Navigation item 2
- href: '#3'
text: Navigation item 3
- href: '#4'
text: Navigation item 4
- name: with custom navigation label
options:
navigationLabel: Custom navigation label
navigation:
- href: '#1'
text: Navigation item 1
active: true
- href: '#2'
text: Navigation item 2
- href: '#3'
text: Navigation item 3
- href: '#4'
text: Navigation item 4
- name: with custom menu button text
description: Button translated into Welsh
options:
menuButtonText: Dewislen
navigation:
- href: '#1'
text: Eitem llywio 1
active: true
- href: '#2'
text: Eitem llywio 2
- href: '#3'
text: Eitem llywio 3
- href: '#4'
text: Eitem llywio 4
- name: with custom menu button label
options:
menuButtonLabel: Custom button label
navigation:
- href: '#1'
text: Navigation item 1
active: true
- href: '#2'
text: Navigation item 2
- href: '#3'
text: Navigation item 3
- href: '#4'
text: Navigation item 4
- name: with service name and navigation
description: If you need to include basic navigation, contact or account management links.
options:
serviceName: Service Name
serviceUrl: '/components/header'
navigation:
- href: '#1'
text: Navigation item 1
active: true
- href: '#2'
text: Navigation item 2
- href: '#3'
text: Navigation item 3
- href: '#4'
text: Navigation item 4
- name: with large navigation
description: An edge case example with a large number of navigation items with long names used to test wrapping
options:
navigation:
- href: '/browse/benefits'
text: Benefits
- href: '/browse/births-deaths-marriages'
text: Births, deaths, marriages and care
- href: '/browse/business'
text: Business and self-employed
- href: '/browse/childcare-parenting'
text: Childcare and parenting
- href: '/browse/citizenship'
text: Citizenship and living in the UK
- href: '/browse/justice'
text: Crime, justice and the law
- href: '/browse/disabilities'
text: Disabled people
- href: '/browse/driving'
text: Driving and transport
- href: '/browse/education'
text: Education and learning
- href: '/browse/employing-people'
text: Employing people
- href: '/browse/environment-countryside'
text: Environment and countryside
- href: '/browse/housing-local-services'
text: Housing and local services
- href: '/browse/tax'
text: Money and tax
- href: '/browse/abroad'
text: Passports, travel and living abroad
- href: '/browse/visas-immigration'
text: Visas and immigration
- href: '/browse/working'
text: Working, jobs and pensions
- name: with product name
options:
navigationClasses: govuk-header__navigation--end
productName: Product Name
- name: full width
options:
containerClasses: govuk-header__container--full-width
navigationClasses: govuk-header__navigation--end
productName: Product Name
- name: full width with navigation
options:
containerClasses: govuk-header__container--full-width
navigationClasses: govuk-header__navigation--end
productName: Product Name
navigation:
- href: '#1'
text: Navigation item 1
active: true
- href: '#2'
text: Navigation item 2
- href: '#3'
text: Navigation item 3
- name: with full width border
description: Makes the header's bottom border full width without affecting the header's content. Removed with redesign.
options:
classes: govuk-header--full-width-border
productName: Product Name
- name: navigation item with html
options:
serviceName: Service Name
serviceUrl: '/components/header'
navigation:
- href: '#1'
html: <em>Navigation item 1</em>
active: true
- href: '#2'
html: <em>Navigation item 2</em>
- href: '#3'
html: <em>Navigation item 3</em>
- name: navigation item with text without link
options:
serviceName: Service Name
serviceUrl: '/components/header'
navigation:
- text: Navigation item 1
- text: Navigation item 2
- text: Navigation item 3
- name: with St. Edward's Crown
description: Does not work if the rebrand is enabled.
options:
useTudorCrown: false
# Hidden examples are not shown in the review app, but are used for tests and HTML fixtures
- name: attributes
hidden: true
options:
attributes:
data-test-attribute: value
data-test-attribute-2: value-2
- name: classes
hidden: true
options:
classes: app-header--custom-modifier
- name: custom homepage url
hidden: true
options:
homepageUrl: /
- name: navigation item with attributes
hidden: true
options:
navigation:
- href: /link
text: Item
attributes:
data-attribute: my-attribute
data-attribute-2: my-attribute-2
- name: navigation item with html as text
hidden: true
options:
serviceName: Service Name
serviceUrl: '/components/header'
navigation:
- href: '#1'
text: <em>Navigation item 1</em>
active: true
- href: '#2'
text: <em>Navigation item 2</em>
- href: '#3'
text: <em>Navigation item 3</em>
- name: navigation item with html without link
hidden: true
options:
serviceName: Service Name
serviceUrl: '/components/header'
navigation:
- html: <em>Navigation item 1</em>
active: true
- html: <em>Navigation item 2</em>
- html: <em>Navigation item 3</em>
- name: with custom navigation label and custom menu button text
hidden: true
options:
menuButtonText: Custom menu button text
navigationLabel: Custom navigation label
navigation:
- href: '#1'
text: Navigation item 1
active: true
- href: '#2'
text: Navigation item 2
- href: '#3'
text: Navigation item 3
- href: '#4'
text: Navigation item 4
- name: empty navigation array
hidden: true
options:
navigation: []
- name: rebrand
hidden: true
options:
rebrand: true