{ "component": "checkboxes", "fixtures": [ { "name": "default", "options": { "name": "nationality", "items": [ { "value": "british", "text": "British" }, { "value": "irish", "text": "Irish" }, { "value": "other", "text": "Citizen of another country" } ] }, "html": "
\n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n\n
", "hidden": false }, { "name": "with divider and None", "options": { "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" } ] }, "html": "
\n\n
\n \n \n \n

\n Which types of waste do you transport regularly?\n

\n \n
\n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n
or
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with divider, None and conditional items", "options": { "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": "\n\n" } }, { "divider": "or" }, { "value": "none", "text": "None of these", "behaviour": "exclusive" } ] }, "html": "
\n\n
\n \n \n \n

\n Do you have any access needs?\n

\n \n
\n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n
\n \n\n\n
\n \n \n \n \n \n \n
or
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with id and name", "options": { "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" } ] }, "html": "
\n\n
\n \n \n \n What is your nationality?\n \n \n \n\n
\n If you have dual nationality, select all options that are relevant to you.\n
\n\n\n
\n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with hints on items", "options": { "name": "with-hints-on-items", "fieldset": { "legend": { "text": "How do you want to sign in?", "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." } } ] }, "html": "
\n\n
\n \n \n \n

\n How do you want to sign in?\n

\n \n
\n \n\n
\n \n \n \n \n \n \n \n
\n \n \n \n
\n You'll have a user ID if you've registered for Self Assessment or filed a tax return online before.\n
\n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n You'll have an account if you've already proved your identity with either Barclays, CitizenSafe, Digidentity, Experian, Post Office, Royal Mail or SecureIdentity.\n
\n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with disabled item", "options": { "name": "colours", "items": [ { "value": "red", "text": "Red" }, { "value": "green", "text": "Green" }, { "value": "blue", "text": "Blue", "disabled": true } ] }, "html": "
\n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n\n
", "hidden": false }, { "name": "with legend as a page heading", "options": { "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" } ] }, "html": "
\n\n
\n \n \n \n

\n Which types of waste do you transport regularly?\n

\n \n
\n \n\n
\n Select all that apply\n
\n\n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with a medium legend", "options": { "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" } ] }, "html": "
\n\n
\n \n \n \n Which types of waste do you transport regularly?\n \n \n \n\n
\n Select all that apply\n
\n\n\n \n \n \n Error: Select which types of waste you transport regularly\n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "without fieldset", "options": { "name": "colours", "items": [ { "value": "red", "text": "Red" }, { "value": "green", "text": "Green" }, { "value": "blue", "text": "Blue" } ] }, "html": "
\n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n\n
", "hidden": false }, { "name": "with single option set 'aria-describedby' on input", "options": { "name": "t-and-c", "errorMessage": { "text": "Please accept the terms and conditions" }, "items": [ { "value": "yes", "text": "I agree to the terms and conditions" } ] }, "html": "
\n\n \n Error: Please accept the terms and conditions\n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n\n
", "hidden": false }, { "name": "with single option (and hint) set 'aria-describedby' on input", "options": { "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!" } } ] }, "html": "
\n\n \n Error: Please accept the terms and conditions\n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n Go on, you know you want to!\n
\n \n
\n \n \n \n \n
\n\n
", "hidden": false }, { "name": "with fieldset and error message", "options": { "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" } ] }, "html": "
\n\n
\n \n \n \n What is your nationality?\n \n \n \n\n \n Error: Please accept the terms and conditions\n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with error message", "options": { "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" } ] }, "html": "
\n\n
\n \n \n \n Which types of waste do you transport regularly?\n \n \n \n\n \n Error: Please select an option\n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with error message and hints on items", "options": { "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." } } ] }, "html": "
\n\n
\n \n \n \n Which types of waste do you transport regularly?\n \n \n \n\n \n Error: Please select an option\n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n Nullam id dolor id nibh ultricies vehicula ut id elit.\n
\n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n Nullam id dolor id nibh ultricies vehicula ut id elit.\n
\n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n Nullam id dolor id nibh ultricies vehicula ut id elit.\n
\n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with very long option text", "options": { "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." } ] }, "html": "
\n\n
\n \n \n \n Maecenas faucibus mollis interdum?\n \n \n \n\n
\n Nullam id dolor id nibh ultricies vehicula ut id elit.\n
\n\n\n \n \n \n Error: Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with conditional items", "options": { "name": "with-conditional-items", "idPrefix": "how-contacted", "fieldset": { "legend": { "text": "How do you want to be contacted?" } }, "items": [ { "value": "email", "text": "Email", "conditional": { "html": "\n\n" } }, { "value": "phone", "text": "Phone", "conditional": { "html": "\n\n" } }, { "value": "text", "text": "Text message", "conditional": { "html": "\n\n" } } ] }, "html": "
\n\n
\n \n \n \n How do you want to be contacted?\n \n \n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n
\n \n\n\n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n
\n \n\n\n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n
\n \n\n\n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with conditional item checked", "options": { "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": "\n\n" } }, { "value": "phone", "text": "Phone", "conditional": { "html": "\n\n" } }, { "value": "text", "text": "Text message", "conditional": { "html": "\n\n" } } ] }, "html": "
\n\n
\n \n \n \n How do you want to be contacted?\n \n \n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n
\n \n\n\n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n
\n \n\n\n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n
\n \n\n\n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with optional form-group classes showing group error", "options": { "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": "\n\n" } }, { "value": "phone", "text": "Phone", "checked": true, "conditional": { "html": "\nProblem with input\n\n" } }, { "value": "text", "text": "Text message", "conditional": { "html": "\n\n" } } ] }, "html": "
\n\n
\n \n \n \n How do you want to be contacted?\n \n \n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n
\n \n\n\n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n
\n \nProblem with input\n\n\n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n
\n \n\n\n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "small", "options": { "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" } ] }, "html": "
\n\n
\n \n \n \n Filter by\n \n \n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "small with long text", "options": { "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." } ] }, "html": "
\n\n
\n \n \n \n Filter by\n \n \n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "small with error", "options": { "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" } ] }, "html": "
\n\n
\n \n \n \n Filter by\n \n \n \n\n \n Error: Select a thing\n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "small with hint", "options": { "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" } ] }, "html": "
\n\n
\n \n \n \n Filter by\n \n \n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n hint for a thing\n
\n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "small with disabled", "options": { "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 } ] }, "html": "
\n\n
\n \n \n \n Filter by\n \n \n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "small with conditional reveal", "options": { "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": "\n\n" } }, { "value": "b", "text": "another thing" } ] }, "html": "
\n\n
\n \n \n \n How do you want to be contacted?\n \n \n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n
\n \n\n\n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": false }, { "name": "with idPrefix", "options": { "name": "example-name", "idPrefix": "nationality", "items": [ { "value": 1, "text": "Option 1" }, { "value": 2, "text": "Option 2" } ] }, "html": "
\n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n\n
", "hidden": true }, { "name": "with falsey values", "options": { "name": "example-name", "items": [ { "value": 1, "text": "Option 1" }, false, null, "", { "value": 2, "text": "Option 2" } ] }, "html": "
\n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n\n
", "hidden": true }, { "name": "classes", "options": { "name": "example-name", "classes": "app-checkboxes--custom-modifier", "items": [ { "value": 1, "text": "Option 1" }, { "value": 2, "text": "Option 2" } ] }, "html": "
\n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n\n
", "hidden": true }, { "name": "with fieldset describedBy", "options": { "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." } }, "html": "
\n\n
\n \n\n
\n If you have dual nationality, select all options that are relevant to you.\n
\n\n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": true }, { "name": "attributes", "options": { "name": "example-name", "attributes": { "data-attribute": "value", "data-second-attribute": "second-value" }, "items": [ { "value": 1, "text": "Option 1" }, { "value": 2, "text": "Option 2" } ] }, "html": "
\n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n\n
", "hidden": true }, { "name": "with checked item", "options": { "name": "example-name", "items": [ { "value": 1, "text": "Option 1" }, { "value": 2, "text": "Option 2", "checked": true }, { "value": 3, "text": "Option 3", "checked": true } ] }, "html": "
\n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n\n
", "hidden": true }, { "name": "items with attributes", "options": { "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" } } ] }, "html": "
\n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n\n
", "hidden": true }, { "name": "empty conditional", "options": { "name": "example-conditional", "items": [ { "value": "foo", "text": "Foo", "conditional": { "html": false } } ] }, "html": "
\n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n\n
", "hidden": true }, { "name": "with label classes", "options": { "name": "example-label-classes", "items": [ { "value": "yes", "text": "Yes", "label": { "classes": "bold" } } ] }, "html": "
\n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n\n
", "hidden": true }, { "name": "multiple hints", "options": { "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" } } ] }, "html": "
\n\n
\n If you have dual nationality, select all options that are relevant to you.\n
\n\n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n Hint for british option here\n
\n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n Hint for other option here\n
\n \n
\n \n \n \n \n
\n\n
", "hidden": true }, { "name": "with error message and hint", "options": { "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." } }, "html": "
\n\n
\n \n \n \n What is your nationality?\n \n \n \n\n
\n If you have dual nationality, select all options that are relevant to you.\n
\n\n\n \n \n \n Error: Please select an option\n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": true }, { "name": "with error, hint and fieldset describedBy", "options": { "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" } ] }, "html": "
\n\n
\n \n \n \n What is your nationality?\n \n \n \n\n
\n If you have dual nationality, select all options that are relevant to you.\n
\n\n\n \n \n \n Error: Please select an option\n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": true }, { "name": "label with attributes", "options": { "name": "example-name", "items": [ { "value": 1, "html": "Option 1", "label": { "attributes": { "data-attribute": "value", "data-second-attribute": "second-value" } } } ] }, "html": "
\n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n\n
", "hidden": true }, { "name": "fieldset params", "options": { "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" } ] }, "html": "
\n\n
\n \n \n \n What is your nationality?\n \n \n \n\n \n Error: Please select an option\n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": true }, { "name": "fieldset html params", "options": { "name": "example-name", "fieldset": { "legend": { "html": "What is your nationality?" } }, "items": [ { "value": "british", "text": "British" }, { "value": "irish", "text": "Irish" } ] }, "html": "
\n\n
\n \n \n \n What is your nationality?\n \n \n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": true }, { "name": "with single option set 'aria-describedby' on input, and describedBy", "options": { "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" } ] }, "html": "
\n\n \n Error: Please accept the terms and conditions\n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n\n
", "hidden": true }, { "name": "with single option (and hint) set 'aria-describedby' on input, and describedBy", "options": { "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!" } } ] }, "html": "
\n\n \n Error: Please accept the terms and conditions\n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n Go on, you know you want to!\n
\n \n
\n \n \n \n \n
\n\n
", "hidden": true }, { "name": "with error and idPrefix", "options": { "name": "name-of-checkboxes", "errorMessage": { "text": "Please select an option" }, "idPrefix": "id-prefix", "items": [ { "value": "animal", "text": "Waste from animal carcasses" } ] }, "html": "
\n\n \n Error: Please select an option\n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n\n
", "hidden": true }, { "name": "with error message and fieldset describedBy", "options": { "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" } ] }, "html": "
\n\n
\n \n \n \n What is your nationality?\n \n \n \n\n \n Error: Please select an option\n \n\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n
\n \n\n
\n\n\n
", "hidden": true } ] }