Sha256: 1b9c0f4978e02796e127fa5a4a1eb4bd5b9c505e3c8b2b42f9ceca6d96d9c205

Contents?: true

Size: 1.15 KB

Versions: 19

Compression:

Stored size: 1.15 KB

Contents

<%
  href ||= false
  text ||= false
  hover_border ||= false

  data_attributes ||= {}
  data_attributes[:module] = 'track-click' if data_attributes.any?
%>
<% if href && text %>
  <% #This assumes the application calling the component supports passing :extra_headers into the layout. %>
  <% #If not, add the following to your application layout file: `yield :extra_headers` %>
  <% content_for :extra_headers do %>
    <link rel="preload" as="image" href="<%= asset_path 'govuk_publishing_components/chevron-banner/chevron-banner-hover.svg' %>" type="image/svg+xml">
    <link rel="preload" as="image" href="<%= asset_path 'govuk_publishing_components/chevron-banner/chevron-banner-hover-border.svg' %>" type="image/svg+xml">
    <link rel="preload" as="image" href="<%= asset_path 'govuk_publishing_components/chevron-banner/chevron-banner-focus.svg' %>" type="image/svg+xml">
  <% end %>

  <div class="gem-c-chevron-banner <%= "gem-c-chevron-banner--hover-border" if hover_border %>">
    <div class="gem-c-chevron-banner__link-container">
      <%= link_to(text, href, class: "gem-c-chevron-banner__link govuk-link", data: data_attributes) %>
    </div>
  </div>
<% end %>

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
govuk_publishing_components-21.7.0 app/views/govuk_publishing_components/components/_chevron_banner.html.erb
govuk_publishing_components-21.6.1 app/views/govuk_publishing_components/components/_chevron_banner.html.erb
govuk_publishing_components-21.6.0 app/views/govuk_publishing_components/components/_chevron_banner.html.erb
govuk_publishing_components-21.5.0 app/views/govuk_publishing_components/components/_chevron_banner.html.erb
govuk_publishing_components-21.4.1 app/views/govuk_publishing_components/components/_chevron_banner.html.erb
govuk_publishing_components-21.4.0 app/views/govuk_publishing_components/components/_chevron_banner.html.erb
govuk_publishing_components-21.3.0 app/views/govuk_publishing_components/components/_chevron_banner.html.erb
govuk_publishing_components-21.2.0 app/views/govuk_publishing_components/components/_chevron_banner.html.erb
govuk_publishing_components-21.1.1 app/views/govuk_publishing_components/components/_chevron_banner.html.erb
govuk_publishing_components-21.1.0 app/views/govuk_publishing_components/components/_chevron_banner.html.erb
govuk_publishing_components-21.0.0 app/views/govuk_publishing_components/components/_chevron_banner.html.erb
govuk_publishing_components-20.5.2 app/views/govuk_publishing_components/components/_chevron_banner.html.erb
govuk_publishing_components-20.5.1 app/views/govuk_publishing_components/components/_chevron_banner.html.erb
govuk_publishing_components-20.5.0 app/views/govuk_publishing_components/components/_chevron_banner.html.erb
govuk_publishing_components-20.4.0 app/views/govuk_publishing_components/components/_chevron_banner.html.erb
govuk_publishing_components-20.3.0 app/views/govuk_publishing_components/components/_chevron_banner.html.erb
govuk_publishing_components-20.2.2 app/views/govuk_publishing_components/components/_chevron_banner.html.erb
govuk_publishing_components-20.2.1 app/views/govuk_publishing_components/components/_chevron_banner.html.erb
govuk_publishing_components-20.2.0 app/views/govuk_publishing_components/components/_chevron_banner.html.erb