1. Collections Component Guide
  2. Modal dialogue (experimental)
  3. With data attributes
Modal dialogue (experimental) example

With data attributes

How it looks (preview)

How to call this example

<button class="govuk-button" data-toggle="modal" data-target="modal-with-data-attributes">Open modal with data attributes</button>
<%= render "govuk_publishing_components/components/modal_dialogue", {
  id: "modal-with-data-attributes",
  data_attributes: {
    gtm: "modal"
  }
} do %>
  <h1 class="govuk-heading-l">Modal title</h1>
<p class="govuk-body">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed imperdiet fringilla dictum. Morbi at vehicula augue. Pellentesque varius orci et augue pellentesque, sed elementum massa posuere. Curabitur egestas consectetur arcu, in porta lorem sagittis eu. Nulla facilisi. Sed scelerisque ligula lectus. Nulla et ligula a eros laoreet lacinia nec et ipsum. Ut sagittis sapien est, ut blandit risus laoreet at. Vestibulum vitae erat sed dolor ultricies efficitur.</p>
<% end %>