1. Component Guide
  2. Single page notification button
  3. With js enhancement
Single page notification button example

With js enhancement

If the js-enhancement flag is present, the component uses JavaScript to check if the user has already subscribed to email notifications on the current page. If yes, the state of the component updates accordingly.

How it looks (preview)

How to call this example

<%= render "govuk_publishing_components/components/single_page_notification_button", {
  base_path: "/current-page-path",
  js_enhancement: true
} %>