Sha256: 4730c93a9bc615916fc6a983e9e738d461ea1105d7c40a2cd0205bc639f28046

Contents?: true

Size: 1.05 KB

Versions: 72

Compression:

Stored size: 1.05 KB

Contents

<%
  add_gem_component_stylesheet("button")
  disable_ga4 ||= false

  # button_helper.css_classes generates "gem-c-button"
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
  local_assigns[:classes] = shared_helper.classes
  button = GovukPublishingComponents::Presenters::ButtonHelper.new(local_assigns)
%>

<% start_button_text = capture do %>
  <span>
    <%= button.text %>
  </span>
  <svg class="govuk-button__start-icon govuk-!-display-none-print" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" focusable="false" aria-hidden="true">
    <path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z" />
  </svg>
<% end %>

<%
  if button.start
    button_text = start_button_text
  else
    button_text = button.text
  end
%>

<% if button.link? %>
  <%= link_to button_text, button.href, **button.html_options %>
<% else %>
  <%= content_tag :button, button_text, **button.html_options %>
<% end %>

<% if button.info_text %>
  <%= tag.span button.info_text, **button.info_text_options %>
<% end %>

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
govuk_publishing_components-45.2.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-45.1.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-45.0.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-44.11.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-44.10.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-44.9.1 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-44.9.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-44.8.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-44.7.1 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-44.7.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-44.6.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-44.5.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-44.4.2 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-44.4.1 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-44.4.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-44.3.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-44.2.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-44.1.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-44.0.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-43.5.0 app/views/govuk_publishing_components/components/_button.html.erb