Option select example
With data attributes on checkboxes
How it looks
(preview)
How to call this example
<%= render "govuk_publishing_components/components/option_select", {
key: "list_of_shoes",
title: "List of shoes",
options_container_id: "list_of_shoes",
options: [
{
value: "trainers",
label: "Trainers",
id: "trainers",
data_attributes: {
an_attribute: "some_value1"
}
},
{
value: "plimsolls",
label: "Plimsolls",
id: "plimsolls",
data_attributes: {
an_attribute: "some_value2"
}
},
{
value: "high_heels",
label: "High heels",
id: "high_heels",
data_attributes: {
an_attribute: "some_value3"
}
}
]
} %>