Sha256: 8643e8fbb78d050832a21f085942bbfc0790b8b30f8dabe2747b2bc6836a829d

Contents?: true

Size: 1.38 KB

Versions: 71

Compression:

Stored size: 1.38 KB

Contents

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

<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
  }) }}
  {{ govukHint({
    text: 'You can enter up to ' + (params.maxlength or params.maxwords) + (' words' if params.maxwords else ' characters'),
    id: params.id + '-info',
    classes: 'govuk-character-count__message' + (' ' + params.countMessage.classes if params.countMessage.classes),
    attributes: {
      'aria-live': 'polite'
    }
  }) }}
</div>

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
govuk_publishing_components-21.60.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.59.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.58.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.57.1 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.57.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.56.2 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.56.1 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.56.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.55.4 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.55.3 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.55.2 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.55.1 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.55.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.54.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.53.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.52.1 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.52.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.51.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.50.1 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.50.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk