Select example
With data attributes
Data attributes can be passed to the select component if needed.
How it looks (preview)
How to call this example
<%= render "govuk_publishing_components/components/select", {
id: "dropdown4-3",
label: "With data attributes",
data_attributes: {
another_attribute: "attribute 1",
something_else: "attribute 2"
},
options: [
{
text: "Option one",
value: "option1"
},
{
text: "Option two",
value: "option2"
},
{
text: "Option three",
value: "option3"
}
]
} %>