Sha256: b9b81cc322fef3cea1e98dae1589e1cd2e1c4891eb41cd20c185776b545fe275

Contents?: true

Size: 690 Bytes

Versions: 60

Compression:

Stored size: 690 Bytes

Contents

<%
  id ||= "character-count-#{SecureRandom.hex(4)}"
  maxlength ||= nil
  maxwords ||= nil
  threshold ||= nil
  textarea ||= {}
%>

<%= content_tag :div,
  class: "gem-c-character-count govuk-character-count",
  data: {
    module: "govuk-character-count",
    maxlength: maxlength,
    maxwords: maxwords,
    threshold: threshold
  } do %>

  <%= render "govuk_publishing_components/components/textarea", { id: id, character_count: true }.merge(textarea.symbolize_keys) %>

  <span id="<%= id %>-info" class="govuk-hint govuk-character-count__message" aria-live="polite">
    You can enter up to <%= maxlength || maxwords %> <%= maxwords ? 'words' : 'characters' %>
  </span>
<% end %>

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
govuk_publishing_components-21.22.0 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.21.3 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.21.2 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.21.1 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.21.0 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.20.0 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.19.1 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.19.0 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.18.0 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.17.0 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.16.3 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.16.2 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.16.1 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.16.0 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.15.2 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.15.1 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.15.0 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.14.0 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.13.5 app/views/govuk_publishing_components/components/_character_count.html.erb
govuk_publishing_components-21.13.4 app/views/govuk_publishing_components/components/_character_count.html.erb