diff --git a/app/views/examples/conditional-reveals/index.njk b/app/views/examples/conditional-reveals/index.njk index 63d40e27d7..3b2c90b8df 100644 --- a/app/views/examples/conditional-reveals/index.njk +++ b/app/views/examples/conditional-reveals/index.njk @@ -2,6 +2,7 @@ {% from "back-link/macro.njk" import govukBackLink %} {% from "checkboxes/macro.njk" import govukCheckboxes %} +{% from "fieldset/macro.njk" import govukFieldset %} {% from "radios/macro.njk" import govukRadios %} {% from "input/macro.njk" import govukInput %} @@ -170,6 +171,166 @@ ] }) }} - {% endblock %} +
+ + {% call govukFieldset({ + legend: { + text: "Which colours do you like?", + classes: "govuk-fieldset__legend--l" + } + })%} + +

Primary colours

+ + {{ govukCheckboxes({ + idPrefix: "colour-primary", + name: "colour", + items: [ + { + value: "red", + text: "Red" + }, + { + value: "yellow", + text: "Yellow", + conditional: { + html: '

Orange is much nicer than yellow!

' + } + }, + { + value: "blue", + text: "Blue" + } + ] + }) }} + +

Secondary colours

+ + {{ govukCheckboxes({ + idPrefix: "colour-secondary", + name: "colour", + items: [ + { + value: "green", + text: "Green" + }, + { + value: "purple", + text: "Purple" + }, + { + value: "orange", + text: "Orange", + conditional: { + html: '

I like orange too!

' + } + } + ] + }) }} + +

Other colours

+ + {{ govukCheckboxes({ + idPrefix: "colour-other", + name: "colour", + items: [ + { + value: "imaginary", + text: "An imaginary colour" + }, + { + divider: "or" + }, + { + value: "none", + text: "None of the above", + behaviour: "exclusive" + } + ] + }) }} + + {% endcall %} + +
+ + {% call govukFieldset({ + legend: { + text: "Which colour is your favourite?", + classes: "govuk-fieldset__legend--l" + } + })%} + +

Primary colours

+ + {{ govukRadios({ + idPrefix: "fave-primary", + name: "fave", + items: [ + { + value: "red", + text: "Red" + }, + { + value: "yellow", + text: "Yellow", + conditional: { + html: '

Orange is much nicer than yellow!

' + } + }, + { + value: "blue", + text: "Blue" + } + ] + }) }} + +

Secondary colours

+ + {{ govukRadios({ + idPrefix: "fave-secondary", + name: "fave", + items: [ + { + value: "green", + text: "Green" + }, + { + value: "purple", + text: "Purple" + }, + { + value: "orange", + text: "Orange", + conditional: { + html: '

Orange is my favourite colour!

' + } + } + ] + }) }} + +

Other colours

+ + {{ govukRadios({ + idPrefix: "fave-other", + name: "fave", + items: [ + { + value: "imaginary", + text: "An imaginary colour" + }, + { + divider: "or" + }, + { + value: "none", + text: "None of the above", + behaviour: "exclusive" + } + ] + }) }} + + {% endcall %} + +{% endblock %}