{% from "../../macros/attributes.njk" import govukAttributes %} {% from "../error-message/macro.njk" import govukErrorMessage %} {% from "../fieldset/macro.njk" import govukFieldset %} {% from "../hint/macro.njk" import govukHint %} {% from "../label/macro.njk" import govukLabel %} {#- If an id 'prefix' is not passed, fall back to using the name attribute instead. We need this for error messages and hints as well -#} {% set idPrefix = params.idPrefix if params.idPrefix else params.name %} {#- a record of other elements that we need to associate with the input using aria-describedby – for example hints or error messages -#} {% set describedBy = params.fieldset.describedBy if params.fieldset.describedBy else "" %} {#- fieldset is false by default -#} {% set hasFieldset = true if params.fieldset else false %} {%- macro _radioItem(params, item, index) %} {#- If the user explicitly sets an id, use this instead of the regular idPrefix -#} {#- The first id should not have a number suffix so it's easy to link to from the error summary component -#} {% set itemId = item.id if item.id else idPrefix + ("-" + index if index > 1 else "") %} {% set conditionalId = "conditional-" + itemId %} {%- if item.divider %}