With button data attributes
Allows data attributes to be passed to the component to be added to the expand/collapse button. The attributes are written to the parent element then read by the JavaScript and applied to the button. This is used for tracking purposes.
How it looks (preview)
How to call this example
<%= render "components/expander", {
title: "Organisation",
button_data_attributes: {
ga4_expandable: "",
ga4_event: {
event_name: "select_content",
type: "finder"
}
}
} do %>
Sssh I'm hiding
<% end %>