Sha256: 3eb88e42f5f7fd2ae4c1fcb9ce500b81d98f15cbb0541802c719090dfaa8f4dc

Contents?: true

Size: 1.22 KB

Versions: 19

Compression:

Stored size: 1.22 KB

Contents

{% from "../textarea/macro.njk" import govukTextarea %}

<div class="govuk-character-count" data-module="govuk-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,
    formGroup: params.formGroup,
    classes: 'govuk-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

19 entries across 19 versions & 1 rubygems

Version Path
govuk_publishing_components-21.20.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.19.1 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.19.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.18.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.17.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.16.3 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.16.2 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.16.1 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.16.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.15.2 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.15.1 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.15.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.14.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.13.5 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.13.4 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.13.3 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.13.2 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.13.1 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.13.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk