Sha256: 3139dd7e8aa7b4da35d2fbca49b6936448216d26ecb4c4ab4f3b6449db2b55c6

Contents?: true

Size: 1.33 KB

Versions: 25

Compression:

Stored size: 1.33 KB

Contents

{% from "../error-message/macro.njk" import govukErrorMessage -%}
{% from "../hint/macro.njk" import govukHint %}
{% from "../label/macro.njk" import govukLabel %}
{% from "../textarea/macro.njk" import govukTextarea %}

<div class="govuk-character-count" data-module="character-count"
{%- if params.maxlength %} data-maxlength="{{ params.maxlength }}"{% endif %}
{%- if params.threshold %} data-threshold="{{ params.threshold }}"{% endif %}
{%- if params.maxwords %} data-maxwords="{{ params.maxwords }}"{% endif %}>
  {{ govukTextarea({
    id: params.id,
    name: params.name,
    describedBy: params.id + '-info',
    rows: params.rows,
    value: params.value,
    classes: 'js-character-count ' + (' govuk-textarea--error' if params.errorMessage) + (params.classes if params.classes),
    label: {
      html: params.label.html,
      text: params.label.text,
      classes: params.label.classes,
      isPageHeading: params.label.isPageHeading,
      attributes: params.label.attributes,
      for: params.id
    },
    hint: params.hint,
    errorMessage: params.errorMessage,
    attributes: params.attributes
  }) }}
  <span id="{{ params.id }}-info" class="govuk-hint govuk-character-count__message" aria-live="polite">
    You can enter up to {{ params.maxlength or params.maxwords }} {{'words' if params.maxwords else 'characters' }}
  </span>
</div>

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
govuk_publishing_components-12.20.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.19.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.18.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.17.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.16.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.15.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.14.1 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.14.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.13.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.12.1 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.12.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.11.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.10.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.9.1 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.9.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.8.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.7.1 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.7.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.6.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-12.5.0 node_modules/govuk-frontend/components/character-count/template.njk