forked from alphagov/govuk-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckboxes.yaml
More file actions
917 lines (887 loc) · 26.6 KB
/
checkboxes.yaml
File metadata and controls
917 lines (887 loc) · 26.6 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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
params:
- name: describedBy
type: string
required: false
description: One or more element IDs to add to the input `aria-describedby` attribute without a fieldset, used to provide additional descriptive information for screenreader users.
- name: fieldset
type: object
required: false
description: Options for the fieldset component (for example legend).
isComponent: true
- name: hint
type: object
required: false
description: Options for the hint component (for example text).
isComponent: true
- name: errorMessage
type: object
required: false
description: Options for the error message component. The error message component will not display if you use a falsy value for `errorMessage`, for example `false` or `null`.
isComponent: true
- name: formGroup
type: object
required: false
description: Options for the form-group wrapper.
params:
- name: classes
type: string
required: false
description: Classes to add to the form group (for example to show error state for the whole group).
- name: idPrefix
type: string
required: false
description: String to prefix id for each checkbox item if no id is specified on each item. If not passed, fall back to using the name option instead.
- name: name
type: string
required: true
description: Name attribute for all checkbox items.
- name: items
type: array
required: true
description: Array of checkbox items objects.
params:
- name: text
type: string
required: true
description: If `html` is set, this is not required. Text to use within each checkbox item label. If `html` is provided, the `text` option will be ignored.
- name: html
type: string
required: true
description: If `text` is set, this is not required. HTML to use within each checkbox item label. If `html` is provided, the `text` option will be ignored.
- name: id
type: string
required: false
description: Specific ID attribute for the checkbox item. If omitted, then component global `idPrefix` option will be applied.
- name: name
type: string
required: false
description: Specific name for the checkbox item. If omitted, then component global `name` string will be applied.
- name: value
type: string
required: true
description: Value for the checkbox input.
- name: label
type: object
required: false
description: Provide attributes and classes to each checkbox item label.
isComponent: true
- name: hint
type: object
required: false
description: Provide hint to each checkbox item.
isComponent: true
- name: divider
type: string
required: false
description: Divider text to separate checkbox items, for example the text 'or'.
- name: checked
type: boolean
required: false
description: Whether the checkbox should be checked when the page loads. Takes precedence over the top-level `values` option.
- name: conditional
type: boolean
required: false
description: If `true`, content provided will be revealed when the item is checked.
- name: conditional.html
type: string
required: false
description: Provide content for the conditional reveal.
- name: behaviour
type: string
required: false
description: If set to `exclusive`, implements a 'None of these' type behaviour via JavaScript when checkboxes are clicked.
- name: disabled
type: boolean
required: false
description: If `true`, checkbox will be disabled.
- name: attributes
type: object
required: false
description: HTML attributes (for example data attributes) to add to the checkbox input tag.
- name: values
type: array
required: false
description: Array of values for checkboxes which should be checked when the page loads. Use this as an alternative to setting the `checked` option on each individual item.
- name: classes
type: string
required: false
description: Classes to add to the checkboxes container.
- name: attributes
type: object
required: false
description: HTML attributes (for example data attributes) to add to the anchor tag.
accessibilityCriteria: |
## Conditional reveals
Must:
- be visible as static content if JavaScript is unavailable or fails
- be hidden if JavaScript is available and is collapsed
- indicate if content is expanded or collapsed
- indicate that there is collapsed content to interact with
Note that we have known issues against this criteria: https://github.com/alphagov/govuk_elements/issues/575
examples:
- name: default
data:
name: nationality
items:
- value: british
text: British
- value: irish
text: Irish
- value: other
text: Citizen of another country
- name: with pre-checked values
data:
name: nationality
items:
- value: british
text: British
- value: irish
text: Irish
- value: other
text: Citizen of another country
conditional:
html: |
<div class="govuk-form-group">
<label class="govuk-label" for="input-example">
Country
</label>
<input class="govuk-input" id="other-country" name="other-country" type="text" value="Ravka">
</div>
values:
- british
- other
- name: with divider and None
data:
name: with-divider-and-none
fieldset:
legend:
text: Which types of waste do you transport regularly?
classes: govuk-fieldset__legend--l
isPageHeading: true
items:
- value: animal
text: Waste from animal carcasses
- value: mines
text: Waste from mines or quarries
- value: farm
text: Farm or agricultural waste
- divider: or
- value: none
text: None of these
behaviour: exclusive
- name: with divider, None and conditional items
data:
name: with-divider-and-none-and-conditional-items
fieldset:
legend:
text: Do you have any access needs?
classes: govuk-fieldset__legend--l
isPageHeading: true
items:
- value: accessible-toilets
text: Accessible toilets available
- value: braille
text: Braille translation service available
- value: disabled-car-parking
text: Disabled car parking available
- value: another-access-need
text: Another access need
conditional:
html: |
<label class="govuk-label" for="other-access-needs">Other access needs</label>
<textarea class="govuk-textarea govuk-!-width-one-third" name="other-access-needs" id="other-access-needs"></textarea>
- divider: or
- value: none
text: None of these
behaviour: exclusive
- name: with id and name
data:
name: with-id-and-name
fieldset:
legend:
text: What is your nationality?
hint:
text: If you have dual nationality, select all options that are relevant to you.
items:
- name: british
id: item_british
value: yes
text: British
- name: irish
id: item_irish
value: irish
text: Irish
- name: custom-name-scottish
text: Scottish
value: scottish
- name: with hints on items
data:
name: with-hints-on-items
fieldset:
legend:
text: How do you want to sign in?
classes: govuk-fieldset__legend--l
isPageHeading: true
items:
- name: gateway
id: government-gateway
value: gov-gateway
text: Sign in with Government Gateway
hint:
text: You'll have a user ID if you've registered for Self Assessment or filed a tax return online before.
- name: verify
id: govuk-verify
value: gov-verify
text: Sign in with GOV.UK Verify
hint:
text: You'll have an account if you've already proved your identity with either Barclays, CitizenSafe, Digidentity, Experian, Post Office, Royal Mail or SecureIdentity.
- name: with disabled item
data:
name: sign-in
fieldset:
legend:
text: How do you want to sign in?
classes: govuk-fieldset__legend--l
isPageHeading: true
items:
- name: gateway
id: government-gateway
value: gov-gateway
text: Sign in with Government Gateway
hint:
text: You'll have a user ID if you've registered for Self Assessment or filed a tax return online before.
- name: verify
id: govuk-verify
value: gov-verify
text: Sign in with GOV.UK Verify
hint:
text: You'll have an account if you've already proved your identity with either Barclays, CitizenSafe, Digidentity, Experian, Post Office, Royal Mail or SecureIdentity.
disabled: true
- name: with legend as a page heading
data:
name: waste
fieldset:
legend:
text: Which types of waste do you transport regularly?
classes: govuk-fieldset__legend--l
isPageHeading: true
hint:
text: Select all that apply
items:
- value: animal
text: Waste from animal carcasses
- value: mines
text: Waste from mines or quarries
- value: farm
text: Farm or agricultural waste
- name: with a medium legend
data:
name: waste
fieldset:
legend:
text: Which types of waste do you transport regularly?
classes: govuk-fieldset__legend--m
hint:
text: Select all that apply
errorMessage:
text: Select which types of waste you transport regularly
items:
- value: animal
text: Waste from animal carcasses
- value: mines
text: Waste from mines or quarries
- value: farm
text: Farm or agricultural waste
- name: without fieldset
data:
name: colours
items:
- value: red
text: Red
- value: green
text: Green
- value: blue
text: Blue
- name: with single option set 'aria-describedby' on input
data:
name: t-and-c
errorMessage:
text: Please accept the terms and conditions
items:
- value: yes
text: I agree to the terms and conditions
- name: with single option (and hint) set 'aria-describedby' on input
data:
name: t-and-c-with-hint
errorMessage:
text: Please accept the terms and conditions
items:
- value: yes
text: I agree to the terms and conditions
hint:
text: Go on, you know you want to!
- name: with fieldset and error message
data:
name: nationality
errorMessage:
text: Please accept the terms and conditions
fieldset:
legend:
text: What is your nationality?
items:
- value: british
text: British
- value: irish
text: Irish
- value: other
text: Citizen of another country
- name: with error message
data:
name: waste
errorMessage:
text: Please select an option
fieldset:
legend:
text: Which types of waste do you transport regularly?
items:
- value: animal
text: Waste from animal carcasses
- value: mines
text: Waste from mines or quarries
- value: farm
text: Farm or agricultural waste
- name: with error message and hints on items
data:
name: waste
errorMessage:
text: Please select an option
fieldset:
legend:
text: Which types of waste do you transport regularly?
items:
- value: animal
text: Waste from animal carcasses
hint:
text: Nullam id dolor id nibh ultricies vehicula ut id elit.
- value: mines
text: Waste from mines or quarries
hint:
text: Nullam id dolor id nibh ultricies vehicula ut id elit.
- value: farm
text: Farm or agricultural waste
hint:
text: Nullam id dolor id nibh ultricies vehicula ut id elit.
- name: with very long option text
data:
name: waste
hint:
text:
Nullam id dolor id nibh ultricies vehicula ut id elit.
errorMessage:
text:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
fieldset:
legend:
text:
Maecenas faucibus mollis interdum?
items:
- value: nullam
text:
Nullam id dolor id nibh ultricies vehicula ut id elit. Aenean eu leo
quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
Maecenas faucibus mollis interdum. Donec id elit non mi porta gravida
at eget metus.
- value: aenean
text:
Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis
vestibulum. Donec sed odio dui. Duis mollis, est non commodo luctus,
nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cum sociis
natoque penatibus et magnis dis parturient montes, nascetur ridiculus
mus. Aenean eu leo quam. Pellentesque ornare sem lacinia quam
venenatis vestibulum. Cras mattis consectetur purus sit amet
fermentum.
- value: fusce
text:
Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum
nibh, ut fermentum massa justo sit amet risus. Etiam porta sem
malesuada magna mollis euismod. Praesent commodo cursus magna, vel
scelerisque nisl consectetur et. Etiam porta sem malesuada magna
mollis euismod. Etiam porta sem malesuada magna mollis euismod.
Donec sed odio dui. Sed posuere consectetur est at lobortis.
- name: with conditional items
data:
name: with-conditional-items
idPrefix: how-contacted
fieldset:
legend:
text: How do you want to be contacted?
items:
- value: email
text: Email
conditional:
html: |
<label class="govuk-label" for="context-email">Email address</label>
<input class="govuk-input govuk-!-width-one-third" name="context-email" type="text" id="context-email">
- value: phone
text: Phone
conditional:
html: |
<label class="govuk-label" for="contact-phone">Phone number</label>
<input class="govuk-input govuk-!-width-one-third" name="contact-phone" type="text" id="contact-phone">
- value: text
text: Text message
conditional:
html: |
<label class="govuk-label" for="contact-text-message">Mobile phone number</label>
<input class="govuk-input govuk-!-width-one-third" name="contact-text-message" type="text" id="contact-text-message">
- name: with conditional items with special characters
data:
name: contact-prefs
idPrefix: user.profile[contact-prefs]
fieldset:
legend:
text: How do you want to be contacted?
items:
- value: email
text: Email
conditional:
html: |
<label class="govuk-label" for="context-email">Email address</label>
<input class="govuk-input govuk-!-width-one-third" name="context-email" type="text" id="context-email">
- value: phone
text: Phone
conditional:
html: |
<label class="govuk-label" for="contact-phone">Phone number</label>
<input class="govuk-input govuk-!-width-one-third" name="contact-phone" type="text" id="contact-phone">
- value: text
text: Text message
conditional:
html: |
<label class="govuk-label" for="contact-text-message">Mobile phone number</label>
<input class="govuk-input govuk-!-width-one-third" name="contact-text-message" type="text" id="contact-text-message">
- name: with conditional item checked
data:
name: how-contacted-checked
idPrefix: how-contacted-checked
fieldset:
legend:
text: How do you want to be contacted?
items:
- value: email
text: Email
checked: true
conditional:
html: |
<label class="govuk-label" for="context-email">Email address</label>
<input class="govuk-input govuk-!-width-one-third" name="context-email" type="text" id="context-email">
- value: phone
text: Phone
conditional:
html: |
<label class="govuk-label" for="contact-phone">Phone number</label>
<input class="govuk-input govuk-!-width-one-third" name="contact-phone" type="text" id="contact-phone">
- value: text
text: Text message
conditional:
html: |
<label class="govuk-label" for="contact-text-message">Mobile phone number</label>
<input class="govuk-input govuk-!-width-one-third" name="contact-text-message" type="text" id="contact-text-message">
- name: with optional form-group classes showing group error
data:
name: how-contacted-checked
idPrefix: how-contacted-checked
formGroup:
classes: 'govuk-form-group--error'
fieldset:
legend:
text: How do you want to be contacted?
items:
- value: email
text: Email
conditional:
html: |
<label class="govuk-label" for="context-email">Email address</label>
<input class="govuk-input govuk-!-width-one-third" name="context-email" type="text" id="context-email">
- value: phone
text: Phone
checked: true
conditional:
html: |
<label class="govuk-label" for="contact-phone">Phone number</label>
<span id="contact-phone-error" class="govuk-error-message">Problem with input</span>
<input class="govuk-input govuk-input--error govuk-!-width-one-third" name="contact-phone" type="text" id="contact-phone" aria-describedby="contact-phone-error">
- value: text
text: Text message
conditional:
html: |
<label class="govuk-label" for="contact-text-message">Mobile phone number</label>
<input class="govuk-input govuk-!-width-one-third" name="contact-text-message" type="text" id="contact-text-message">
- name: small
data:
idPrefix: nationality
name: nationality
classes: govuk-checkboxes--small
fieldset:
legend:
text: Filter by
items:
- value: a
text: a thing
- value: b
text: another thing
- value: c
text: this thing
- name: small with long text
data:
idPrefix: nationality
name: nationality
classes: govuk-checkboxes--small
fieldset:
legend:
text: Filter by
items:
- value: nullam
text:
Nullam id dolor id nibh ultricies vehicula ut id elit. Aenean eu leo
quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
Maecenas faucibus mollis interdum. Donec id elit non mi porta gravida
at eget metus.
- value: aenean
text:
Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis
vestibulum. Donec sed odio dui. Duis mollis, est non commodo luctus,
nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cum sociis
natoque penatibus et magnis dis parturient montes, nascetur ridiculus
mus. Aenean eu leo quam. Pellentesque ornare sem lacinia quam
venenatis vestibulum. Cras mattis consectetur purus sit amet
fermentum.
- value: fusce
text:
Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum
nibh, ut fermentum massa justo sit amet risus. Etiam porta sem
malesuada magna mollis euismod. Praesent commodo cursus magna, vel
scelerisque nisl consectetur et. Etiam porta sem malesuada magna
mollis euismod. Etiam porta sem malesuada magna mollis euismod.
Donec sed odio dui. Sed posuere consectetur est at lobortis.
- name: small with error
data:
idPrefix: nationality
name: nationality
classes: govuk-checkboxes--small
errorMessage:
text: "Select a thing"
fieldset:
legend:
text: Filter by
items:
- value: a
text: a thing
- value: b
text: another thing
- value: c
text: this thing
- name: small with hint
data:
idPrefix: nationality
name: nationality
classes: govuk-checkboxes--small
fieldset:
legend:
text: Filter by
items:
- value: a
text: a thing
hint:
text: hint for a thing
- value: b
text: another thing
- value: c
text: this thing
- name: small with disabled
data:
idPrefix: nationality
name: nationality
classes: govuk-checkboxes--small
fieldset:
legend:
text: Filter by
items:
- value: a
text: a thing
- value: b
text: another thing
- value: c
text: this thing
disabled: true
- name: small with conditional reveal
data:
name: how-contacted
idPrefix: how-contacted
classes: govuk-checkboxes--small
fieldset:
legend:
text: How do you want to be contacted?
items:
- value: a
text: a thing
conditional:
html: |
<label class="govuk-label" for="context-email">Foo</label>
<input class="govuk-input govuk-!-width-one-third" name="context-email" type="text" id="context-email">
- value: b
text: another thing
# Hidden examples are not shown in the review app, but are used for tests and HTML fixtures
- name: with idPrefix
hidden: true
data:
name: example-name
idPrefix: nationality
items:
- value: 1
text: Option 1
- value: 2
text: Option 2
- name: with falsey values
hidden: true
data:
name: example-name
items:
- value: 1
text: Option 1
- false
- null
- ""
- value: 2
text: Option 2
- name: classes
hidden: true
data:
name: example-name
classes: app-checkboxes--custom-modifier
items:
- value: 1
text: Option 1
- value: 2
text: Option 2
- name: with fieldset describedBy
hidden: true
data:
name: example-name
fieldset:
describedBy: some-id
items:
- value: 1
text: Option 1
- value: 2
text: Option 2
hint:
text: If you have dual nationality, select all options that are relevant to you.
- name: attributes
hidden: true
data:
name: example-name
attributes:
data-attribute: value
data-second-attribute: second-value
items:
- value: 1
text: Option 1
- value: 2
text: Option 2
- name: with checked item
hidden: true
data:
name: example-name
items:
- value: 1
text: Option 1
- value: 2
text: Option 2
checked: true
- value: 3
text: Option 3
checked: true
- name: items with attributes
hidden: true
data:
name: example-name
items:
- value: 1
text: Option 1
attributes:
data-attribute: ABC
data-second-attribute: DEF
- value: 2
text: Option 2
attributes:
data-attribute: GHI
data-second-attribute: JKL
- name: empty conditional
hidden: true
data:
name: example-conditional
items:
- value: foo
text: Foo
conditional:
html: false
- name: with label classes
hidden: true
data:
name: example-label-classes
items:
- value: yes
text: Yes
label:
classes: bold
- name: multiple hints
hidden: true
data:
name: example-multiple-hints
hint:
text: If you have dual nationality, select all options that are relevant to you.
items:
- value: british
text: British
hint:
text: Hint for british option here
- value: irish
text: Irish
- value: other
hint:
text: Hint for other option here
- name: with error message and hint
hidden: true
data:
name: example
items:
- value: british
text: British
- value: irish
text: Irish
errorMessage:
text: Please select an option
fieldset:
legend:
text: What is your nationality?
hint:
text: If you have dual nationality, select all options that are relevant to you.
- name: with error, hint and fieldset describedBy
hidden: true
data:
name: example
errorMessage:
text: Please select an option
fieldset:
describedBy: some-id
legend:
text: What is your nationality?
hint:
text: If you have dual nationality, select all options that are relevant to you.
items:
- value: british
text: British
- value: irish
text: Irish
- name: label with attributes
hidden: true
data:
name: example-name
items:
- value: 1
html: <b>Option 1</b>
label:
attributes:
data-attribute: value
data-second-attribute: second-value
- name: fieldset params
hidden: true
data:
name: example-name
errorMessage:
text: Please select an option
fieldset:
legend:
text: What is your nationality?
classes: app-fieldset--custom-modifier
attributes:
data-attribute: value
data-second-attribute: second-value
items:
- value: british
text: British
- value: irish
text: Irish
- name: fieldset html params
hidden: true
data:
name: example-name
fieldset:
legend:
html: What is your <b>nationality</b>?
items:
- value: british
text: British
- value: irish
text: Irish
- name: with single option set 'aria-describedby' on input, and describedBy
hidden: true
data:
describedBy: some-id
name: t-and-c
errorMessage:
text: Please accept the terms and conditions
items:
- value: yes
text: I agree to the terms and conditions
- name: with single option (and hint) set 'aria-describedby' on input, and describedBy
hidden: true
data:
describedBy: some-id
name: t-and-c-with-hint
errorMessage:
text: Please accept the terms and conditions
items:
- value: yes
text: I agree to the terms and conditions
hint:
text: Go on, you know you want to!
- name: with error and idPrefix
hidden: true
data:
name: name-of-checkboxes
errorMessage:
text: Please select an option
idPrefix: id-prefix
items:
- value: animal
text: Waste from animal carcasses
- name: with error message and fieldset describedBy
hidden: true
data:
name: example
errorMessage:
text: Please select an option
fieldset:
describedBy: some-id
legend:
text: What is your nationality?
items:
- value: british
text: British
- value: irish
text: Irish
- name: item checked overrides values
hidden: true
data:
name: colors
items:
- value: red
text: Red
- value: green
text: Green
checked: false
- value: blue
text: Blue
values: [red, green]