Skip to content
Fleetline

Password input

Usage

Use a password input for sign-in and for setting a new password on the Fleetline workshop tablet or dispatch console. Use a one-time-code input for SMS or authenticator codes.

Anatomy

  1. Container — .input.input--affixed.password (from text field)
  2. Input — input.input__control[type=password]
  3. Reveal toggle — button.password__toggle[aria-pressed], icon + "Show" / "Hide"
  4. Strength (optional) — meter.password__meter + .password__strength-text
  5. Requirements (optional) — ul.password__rules, items with data-met

Examples

Hover and focus-visible are frozen with .is-hover and .is-focus-visible, which share their rules with the real pseudo-classes.

Password input

Error: Enter your password.

Use at least 12 characters. A short phrase is easier to type on a tablet.

Password strength: Good
  • At least 12 characters
  • A number
  • A symbol, like ! or #
<div class="input input--affixed password">
        <input class="input__control" id="password" type="password" autocomplete="current-password">
        <!-- ships hidden; js/password-input.js reveals it and switches type + aria-pressed + label -->
        <button type="button" class="password__toggle" aria-controls="password" aria-pressed="false" hidden>
          <svg class="icon" aria-hidden="true"><use href="#icon-eye"></use></svg><span data-label>Show</span><span class="sr-only"> password</span>
        </button>
      </div>

      <!-- Strength + requirements (new passwords) -->
      <input class="input__control" type="password" autocomplete="new-password" data-strength="pw-meter" data-rules="pw-rules">
      <div class="password__strength">
        <meter class="password__meter" id="pw-meter" min="0" max="4" low="2" high="3" optimum="4" value="0"></meter>
        <span class="password__strength-text" data-strength-text></span>
      </div>
      <ul class="password__rules" id="pw-rules">
        <li data-rule="length:12">…At least 12 characters</li>
        <li data-rule="digit">…A number</li>
      </ul>

API

HookValuesPurpose
.passwordblock class (with .input--affixed)Password field with an inline toggle
.password__togglepartReveal button; aria-pressed true while visible; aria-controls → input id
autocompletecurrent-password | new-passwordPassword manager behavior
data-strengthmeter idDrives meter.password__meter (0–4) and its text
data-ruleslist idUpdates li[data-rule] → data-met; rules: length:N, digit, upper, symbol
aria-invalid="true"attributeInvalid styling (on the input)
.is-hover | .is-focus-visibledocs-only classFreezes a toggle state

Do and don't

Do show a reveal toggle with a text label and keep paste working.
Don't hide the rules in a placeholder or cap the maximum length.

Accessibility

Keyboard interaction
KeyBehavior
TabInput, then the Show button
Enter / Space on the toggleShows or hides the password; focus stays on the toggle

Tokens

Custom propertyPurpose
--input-*, --focus-ring-*Field border and focus (from text field)
--color-action-ghost-bg | -hover | -active, --color-action-ghost-fgToggle button
--color-feedback-success|warning|danger-iconMeter fill by strength
--color-feedback-success-fgMet requirement
--color-bg-mutedMeter track