With aria controls attributes
Aria controls attributes are applied to the checkboxes only if JavaScript is enabled.
How it looks (preview)
How to call this example
<%= render "govuk_publishing_components/components/checkboxes", {
name: "aria_controls[]",
heading: "What areas are you interested in?",
items: [
{
label: "Farming and the environment",
value: "farming",
controls: "js-live-results"
},
{
label: "Water recycling",
value: "water",
controls: "js-live-results"
}
]
} %>