Skip to main content
Preview This is a design system preview environment for main branch

Internal review app NHS.UK frontend

Use design system guidance and examples to build consistent, accessible NHS services for the public and staff.

Password input

These examples are used for automated tests and may not follow service manual best practice.

Code

Markup

<div class="nhsuk-form-group nhsuk-password-input" data-module="nhsuk-password-input">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--l" for="example">
      Password
    </label>
  </h1>
  <div class="nhsuk-input-wrapper">
    <input class="nhsuk-input nhsuk-password-input__input nhsuk-js-password-input-input" id="example" name="example" type="password" spellcheck="false" autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" type="button" aria-label="Show password" aria-controls="example" hidden>
      Show
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Password",
    size: "l"
  },
  name: "example"
}) }}

Code

Markup

<div class="nhsuk-form-group nhsuk-password-input" data-module="nhsuk-password-input">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--l" for="example">
      Password
    </label>
  </h1>
  <div class="nhsuk-input-wrapper">
    <input class="nhsuk-input nhsuk-password-input__input nhsuk-js-password-input-input" id="example" name="example" type="password" spellcheck="false" disabled autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" type="button" disabled aria-label="Show password" aria-disabled="true" aria-controls="example" hidden>
      Show
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Password",
    size: "l"
  },
  name: "example",
  disabled: true
}) }}

Code

Markup

<div class="nhsuk-form-group nhsuk-password-input" data-module="nhsuk-password-input">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--l" for="example">
      Password
    </label>
  </h1>
  <div class="nhsuk-input-wrapper">
    <input class="nhsuk-input nhsuk-password-input__input nhsuk-js-password-input-input" id="example" name="example" type="password" spellcheck="false" autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" type="button" disabled aria-label="Show password" aria-disabled="true" aria-controls="example" hidden>
      Show
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Password",
    size: "l"
  },
  name: "example",
  button: {
    disabled: true
  }
}) }}

Code

Markup

<div class="nhsuk-form-group nhsuk-password-input" data-module="nhsuk-password-input">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--l" for="example">
      Password
    </label>
  </h1>
  <div class="nhsuk-input-wrapper">
    <input class="nhsuk-input nhsuk-password-input__input nhsuk-js-password-input-input" id="example" name="example" type="password" spellcheck="false" disabled autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" type="button" aria-label="Show password" aria-controls="example" hidden>
      Show
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Password",
    size: "l"
  },
  name: "example",
  disabled: true,
  button: {
    disabled: false
  }
}) }}

Code

Markup

<div class="nhsuk-form-group nhsuk-password-input" data-module="nhsuk-password-input">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--l" for="new-password">
      Password
    </label>
  </h1>
  <div class="nhsuk-input-wrapper">
    <input class="nhsuk-input nhsuk-password-input__input nhsuk-js-password-input-input" id="new-password" name="example" type="password" spellcheck="false" autocomplete="new-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" type="button" aria-label="Show password" aria-controls="new-password" hidden>
      Show
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Password",
    size: "l"
  },
  id: "new-password",
  name: "example",
  autocomplete: "new-password"
}) }}

Before After
Code

Markup

<div class="nhsuk-form-group nhsuk-password-input" data-module="nhsuk-password-input">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--l" for="example">
      Password
    </label>
  </h1>
  <div class="nhsuk-input-wrapper">
    <samp class="app-annotate">Before</samp>
    <input class="nhsuk-input nhsuk-password-input__input nhsuk-js-password-input-input" id="example" name="example" type="password" spellcheck="false" autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" type="button" aria-label="Show password" aria-controls="example" hidden>
      Show
    </button>
    <samp class="app-annotate">After</samp>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Password",
    size: "l"
  },
  name: "example",
  formGroup: {
    beforeInput: {
      html: '<samp class="app-annotate">Before</samp>'
    },
    afterInput: {
      html: '<samp class="app-annotate">After</samp>'
    }
  }
}) }}

Code

Markup

<div class="nhsuk-form-group nhsuk-password-input" data-module="nhsuk-password-input">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--l" for="example">
      Password
    </label>
  </h1>
  <div class="nhsuk-input-wrapper">
    <input class="nhsuk-input nhsuk-password-input__input nhsuk-js-password-input-input" id="example" name="example" type="password" spellcheck="false" autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" data-prevent-double-click="false" type="button" aria-label="Show password" aria-controls="example" hidden>
      Show
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Password",
    size: "l"
  },
  name: "example",
  button: {
    preventDoubleClick: false
  }
}) }}

Code

Markup

<div class="nhsuk-form-group nhsuk-password-input" data-module="nhsuk-password-input">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--l" for="example">
      Password
    </label>
  </h1>
  <div class="nhsuk-input-wrapper">
    <input class="nhsuk-input nhsuk-password-input__input nhsuk-js-password-input-input" id="example" name="example" type="password" spellcheck="false" autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" data-prevent-double-click="true" type="button" aria-label="Show password" aria-controls="example" hidden>
      Show
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Password",
    size: "l"
  },
  name: "example",
  button: {
    preventDoubleClick: true
  }
}) }}

Error: Enter a password

Code

Markup

<div class="nhsuk-form-group nhsuk-form-group--error nhsuk-password-input" data-module="nhsuk-password-input">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--l" for="with-error-message">
      Password
    </label>
  </h1>
  <p class="nhsuk-error-message" id="with-error-message-error">
    <span class="nhsuk-u-visually-hidden">Error: </span>Enter a password
  </p>
  <div class="nhsuk-input-wrapper">
    <input class="nhsuk-input nhsuk-input--error nhsuk-password-input__input nhsuk-js-password-input-input" id="with-error-message" name="example" type="password" spellcheck="false" aria-describedby="with-error-message-error" autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" type="button" aria-label="Show password" aria-controls="with-error-message" hidden>
      Show
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Password",
    size: "l"
  },
  errorMessage: {
    text: "Enter a password"
  },
  id: "with-error-message",
  name: "example"
}) }}

It probably has some letters, numbers and maybe even some symbols in it

Error: Enter a password

Code

Markup

<div class="nhsuk-form-group nhsuk-form-group--error nhsuk-password-input" data-module="nhsuk-password-input">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--l" for="with-error-message">
      Password
    </label>
  </h1>
  <div class="nhsuk-hint" id="with-error-message-hint">
    It probably has some letters, numbers and maybe even some symbols in it
  </div>
  <p class="nhsuk-error-message" id="with-error-message-error">
    <span class="nhsuk-u-visually-hidden">Error: </span>Enter a password
  </p>
  <div class="nhsuk-input-wrapper">
    <input class="nhsuk-input nhsuk-input--error nhsuk-password-input__input nhsuk-js-password-input-input" id="with-error-message" name="example" type="password" spellcheck="false" aria-describedby="with-error-message-hint with-error-message-error" autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" type="button" aria-label="Show password" aria-controls="with-error-message" hidden>
      Show
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Password",
    size: "l"
  },
  hint: {
    text: "It probably has some letters, numbers and maybe even some symbols in it"
  },
  errorMessage: {
    text: "Enter a password"
  },
  id: "with-error-message",
  name: "example"
}) }}

It probably has some letters, numbers and maybe even some symbols in it

Error: Enter a password

Code

Markup

<div class="nhsuk-form-group nhsuk-form-group--error nhsuk-password-input" data-module="nhsuk-password-input">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--l" for="with-error-message">
      Password
    </label>
  </h1>
  <div class="nhsuk-hint" id="with-error-message-hint">
    It probably has some letters, numbers and maybe even some symbols in it
  </div>
  <p class="nhsuk-error-message" id="with-error-message-error">
    <span class="nhsuk-u-visually-hidden">Error: </span>Enter a password
  </p>
  <div class="nhsuk-input-wrapper">
    <input class="nhsuk-input nhsuk-input--error nhsuk-password-input__input nhsuk-js-password-input-input" id="with-error-message" name="example" type="password" spellcheck="false" aria-describedby="with-error-message-hint with-error-message-error" autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" type="button" aria-label="Show password" aria-controls="with-error-message" hidden>
      Show
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Password",
    size: "l"
  },
  hint: "It probably has some letters, numbers and maybe even some symbols in it",
  errorMessage: "Enter a password",
  id: "with-error-message",
  name: "example"
}) }}

Password input with error message and hint, without heading

Open this example in a new tab: Password input with error message and hint, without heading

It probably has some letters, numbers and maybe even some symbols in it

Error: Enter a password

Code

Markup

<div class="nhsuk-form-group nhsuk-form-group--error nhsuk-password-input" data-module="nhsuk-password-input">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--l" for="with-error-message">
      Password
    </label>
  </h1>
  <div class="nhsuk-hint" id="with-error-message-hint">
    It probably has some letters, numbers and maybe even some symbols in it
  </div>
  <p class="nhsuk-error-message" id="with-error-message-error">
    <span class="nhsuk-u-visually-hidden">Error: </span>Enter a password
  </p>
  <div class="nhsuk-input-wrapper">
    <input class="nhsuk-input nhsuk-input--error nhsuk-password-input__input nhsuk-js-password-input-input" id="with-error-message" name="example" type="password" spellcheck="false" aria-describedby="with-error-message-hint with-error-message-error" autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" type="button" aria-label="Show password" aria-controls="with-error-message" hidden>
      Show
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Password",
    size: "l"
  },
  hint: {
    text: "It probably has some letters, numbers and maybe even some symbols in it"
  },
  errorMessage: {
    text: "Enter a password"
  },
  id: "with-error-message",
  name: "example"
}) }}

Error: Enter a password

Code

Markup

<div class="nhsuk-form-group nhsuk-form-group--error nhsuk-password-input" data-module="nhsuk-password-input">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--l" for="with-error-message">
      Password
    </label>
  </h1>
  <p class="nhsuk-error-message" id="with-error-message-error">
    <span class="nhsuk-u-visually-hidden">Error: </span>Enter a password
  </p>
  <div class="nhsuk-input-wrapper">
    <input class="nhsuk-input nhsuk-input--error nhsuk-password-input__input nhsuk-js-password-input-input" id="with-error-message" name="example" type="password" spellcheck="false" aria-describedby="with-error-message-error" autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" type="button" aria-label="Show password" aria-controls="with-error-message" hidden>
      Show
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Password",
    size: "l"
  },
  errorMessage: {
    text: "Enter a password"
  },
  id: "with-error-message",
  name: "example"
}) }}

Code

Markup

<div class="nhsuk-form-group nhsuk-form-group--error nhsuk-password-input" data-module="nhsuk-password-input">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--l" for="with-error-only">
      Password
    </label>
  </h1>
  <div class="nhsuk-input-wrapper">
    <input class="nhsuk-input nhsuk-input--error nhsuk-password-input__input nhsuk-js-password-input-input" id="with-error-only" name="example" type="password" spellcheck="false" autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" type="button" aria-label="Show password" aria-controls="with-error-only" hidden>
      Show
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Password",
    size: "l"
  },
  errorMessage: true,
  id: "with-error-only",
  name: "example"
}) }}

It probably has some letters, numbers and maybe even some symbols in it
Code

Markup

<div class="nhsuk-form-group nhsuk-password-input" data-module="nhsuk-password-input">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--l" for="with-hint-text">
      Password
    </label>
  </h1>
  <div class="nhsuk-hint" id="with-hint-text-hint">
    It probably has some letters, numbers and maybe even some symbols in it
  </div>
  <div class="nhsuk-input-wrapper">
    <input class="nhsuk-input nhsuk-password-input__input nhsuk-js-password-input-input" id="with-hint-text" name="example" type="password" spellcheck="false" aria-describedby="with-hint-text-hint" autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" type="button" aria-label="Show password" aria-controls="with-hint-text" hidden>
      Show
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Password",
    size: "l"
  },
  hint: {
    text: "It probably has some letters, numbers and maybe even some symbols in it"
  },
  id: "with-hint-text",
  name: "example"
}) }}
Code

Markup

<div class="nhsuk-form-group nhsuk-password-input" data-module="nhsuk-password-input">
  <label class="nhsuk-label" for="without-heading">
    Password
  </label>
  <div class="nhsuk-input-wrapper">
    <input class="nhsuk-input nhsuk-password-input__input nhsuk-js-password-input-input" id="without-heading" name="example" type="password" spellcheck="false" autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" type="button" aria-label="Show password" aria-controls="without-heading" hidden>
      Show
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: "Password",
  id: "without-heading",
  name: "example"
}) }}

Code

Markup

<div class="nhsuk-form-group nhsuk-password-input" data-module="nhsuk-password-input">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--m" for="with-prefix">
      Secret code
    </label>
  </h1>
  <div class="nhsuk-input-wrapper">
    <div class="nhsuk-input-wrapper__prefix" aria-hidden="true">PIN</div>
    <input class="nhsuk-input nhsuk-input--code nhsuk-input--width-5 nhsuk-password-input__input nhsuk-js-password-input-input" id="with-prefix" name="example" type="password" spellcheck="false" value="3.14159" autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--brand nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" type="button" aria-label="Show password" aria-controls="with-prefix" hidden>
      Show
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Secret code",
    size: "m"
  },
  prefix: {
    text: "PIN"
  },
  id: "with-prefix",
  name: "example",
  value: "3.14159",
  width: 5,
  code: true,
  button: {
    variant: "brand"
  }
}) }}

Error: Enter secret code

Code

Markup

<div class="nhsuk-form-group nhsuk-form-group--error nhsuk-password-input" data-module="nhsuk-password-input">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--m" for="with-prefix">
      Secret code
    </label>
  </h1>
  <p class="nhsuk-error-message" id="with-prefix-error">
    <span class="nhsuk-u-visually-hidden">Error: </span>Enter secret code
  </p>
  <div class="nhsuk-input-wrapper">
    <div class="nhsuk-input-wrapper__prefix" aria-hidden="true">PIN</div>
    <input class="nhsuk-input nhsuk-input--code nhsuk-input--error nhsuk-input--width-5 nhsuk-password-input__input nhsuk-js-password-input-input" id="with-prefix" name="example" type="password" spellcheck="false" aria-describedby="with-prefix-error" autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--brand nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" type="button" aria-label="Show password" aria-controls="with-prefix" hidden>
      Show
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Secret code",
    size: "m"
  },
  prefix: {
    text: "PIN"
  },
  errorMessage: {
    text: "Enter secret code"
  },
  id: "with-prefix",
  name: "example",
  width: 5,
  code: true,
  button: {
    variant: "brand"
  }
}) }}

Code

Markup

<div class="nhsuk-form-group nhsuk-password-input" data-module="nhsuk-password-input" data-i18n.show-password="Dangos" data-i18n.hide-password="Cuddio" data-i18n.show-password-aria-label="Dangos cyfrinair" data-i18n.hide-password-aria-label="Cuddio cyfrinair" data-i18n.password-shown-announcement="Mae eich cyfrinair yn weladwy." data-i18n.password-hidden-announcement="Mae eich cyfrinair wedi&#39;i guddio.">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--l" for="password-translated">
      Cyfrinair
    </label>
  </h1>
  <div class="nhsuk-input-wrapper">
    <input class="nhsuk-input nhsuk-password-input__input nhsuk-js-password-input-input" id="password-translated" name="example" type="password" spellcheck="false" autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" type="button" aria-label="Dangos cyfrinair" aria-controls="password-translated" hidden>
      Dangos
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Cyfrinair",
    size: "l"
  },
  id: "password-translated",
  name: "example",
  showPasswordText: "Dangos",
  hidePasswordText: "Cuddio",
  showPasswordAriaLabel: "Dangos cyfrinair",
  hidePasswordAriaLabel: "Cuddio cyfrinair",
  passwordShownAnnouncementText: "Mae eich cyfrinair yn weladwy.",
  passwordHiddenAnnouncementText: "Mae eich cyfrinair wedi'i guddio."
}) }}

Code

Markup

<div class="nhsuk-form-group nhsuk-password-input" data-module="nhsuk-password-input">
  <h1 class="nhsuk-label-wrapper">
    <label class="nhsuk-label nhsuk-label--l" for="width-class">
      Password
    </label>
  </h1>
  <div class="nhsuk-input-wrapper">
    <input class="nhsuk-input nhsuk-input--width-10 nhsuk-password-input__input nhsuk-js-password-input-input" id="width-class" name="example" type="password" spellcheck="false" autocomplete="current-password" autocapitalize="none">
    <button class="nhsuk-button nhsuk-button--secondary nhsuk-button--small nhsuk-password-input__toggle nhsuk-js-password-input-toggle" data-module="nhsuk-button" type="button" aria-label="Show password" aria-controls="width-class" hidden>
      Show
    </button>
  </div>
</div>

Macro

{% from "password-input/macro.njk" import passwordInput -%}

{{ passwordInput({
  label: {
    heading: "Password",
    size: "l"
  },
  id: "width-class",
  name: "example",
  width: 10
}) }}