Sha256: 3fce4f524c6edec51d6dfc975c08ae5381e81661fa4c37b86c6cfda2c7f41d75

Contents?: true

Size: 1.22 KB

Versions: 18

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

18 entries across 18 versions & 1 rubygems

Version Path
govuk_publishing_components-21.12.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.11.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.10.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.9.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.8.1 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.8.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.7.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.6.1 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.6.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.5.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.4.1 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.4.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.3.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.2.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.1.1 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.1.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-21.0.0 node_modules/govuk-frontend/govuk/components/character-count/template.njk
govuk_publishing_components-20.5.2 node_modules/govuk-frontend/govuk/components/character-count/template.njk