Sha256: 83eff7f6e51e1f8376e779eec445a9ddc013102214ff1dbac9faf4993c783acc

Contents?: true

Size: 649 Bytes

Versions: 2

Compression:

Stored size: 649 Bytes

Contents

<%
  id ||= "input-#{SecureRandom.hex(4)}"
  hint_id ||= "hint-#{SecureRandom.hex(4)}"
  value ||= false
  error_message ||= false
  label ||= {}
%>

<%= render "govuk_publishing_components/components/label", {
  text: label[:text],
  html_for: id,
  hint_text: error_message,
  hint_text_classes: "gem-c-input__label-error",
  hint_id: hint_id,
  bold: error_message ? true : false,
} %>

<input
  class="gem-c-input <%= "gem-c-input--error" if error_message %>"
  id="<%= id %>"
  name="<%= name %>"
  type="text"

  <% if error_message %>
    aria-describedby="<%= hint_id %>"
  <% end %>

  <% if value %>
    value="<%= value %>"
  <% end %>
>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
govuk_publishing_components-5.0.0 app/views/govuk_publishing_components/components/_input.html.erb
govuk_publishing_components-4.1.1 app/views/govuk_publishing_components/components/_input.html.erb