Sha256: e29671359b34fe902d6ce8b8a60bab6c55afa9ad78648610d56ec7ed5e5854e9

Contents?: true

Size: 1.17 KB

Versions: 84

Compression:

Stored size: 1.17 KB

Contents

{% 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

84 entries across 84 versions & 1 rubygems

Version Path
govuk_publishing_components-17.21.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.20.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.19.1 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.19.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.18.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.17.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.16.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.15.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.14.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.13.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.12.2 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.12.1 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.12.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.11.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.10.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.9.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.8.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.7.0 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.6.1 node_modules/govuk-frontend/components/character-count/template.njk
govuk_publishing_components-17.6.0 node_modules/govuk-frontend/components/character-count/template.njk