Skip to content

Password Strength Meter for Angular

AngularAuthentication UI

Advisory password feedback: a requirements checklist (length, character classes, custom rules) and a strength rating from a pluggable evaluator, with debounced polite announcements. Attaches to a Password Input (or any <input>) or evaluates a bound value. It is not a security guarantee: the server must enforce the real policy.

  • Follows any inputAttach it to a Password Input or a native input and it rates as the user types.
  • Requirement checklistShows each rule as met or unmet, with built-in and custom requirements.
  • Your own evaluatorReplace the default scoring with your own function.
  • Polite announcementsScore changes are announced after a pause, not on every keystroke.

Behavior, design tokens, and limitations are described on the Password Strength Meter page; this page covers the Angular API.

import { Component } from '@angular/core';
import { FormControl, ReactiveFormsModule } from '@angular/forms';
import { AuiPasswordInput } from '@absoluteui/angular/password-input';
import { AuiPasswordStrengthMeter } from '@absoluteui/angular/password-strength-meter';
@Component({
selector: 'app-sign-up',
imports: [ReactiveFormsModule, AuiPasswordInput, AuiPasswordStrengthMeter],
template: `
<aui-password-input label="New password" autocomplete="new-password" [formControl]="password"></aui-password-input>
<aui-password-strength-meter [value]="password.value"></aui-password-strength-meter>
`,
})
export class SignUpComponent {
readonly password = new FormControl('', { nonNullable: true });
}
Terminal window
npm install @absoluteui/angular @absoluteui/components @absoluteui/core @absoluteui/theme

Setup with provideAbsoluteUI() is covered in Getting started. Styles are included with the component.

import { AuiPasswordStrengthMeter } from '@absoluteui/angular/password-strength-meter';

Defaults for every instance: provideAbsoluteUIConfig({ components: { passwordStrengthMeter: { ... } } }) (see Configuration).

Class AuiPasswordStrengthMeter; template reference #ref="auiPasswordStrengthMeter".

Server rendering: Renders on the server; the browser re-creates it after hydration.

Input Type Default Description
label string Visible heading. Default: localized “Password strength”.
input PasswordStrengthTarget Input to follow (Password Input, Text Input, or the element).
value string Evaluate this value instead of following an input (framework bindings).
requirements readonly PasswordRequirement[] Checklist rules. Default: defaultPasswordRequirements().
evaluate PasswordStrengthEvaluator Scoring. Default: defaultPasswordEvaluator (advisory).
icons Partial<PasswordStrengthMeterIcons> Icon slot overrides.
showRequirements boolean true Render the requirements checklist.
announce boolean true Announce the rating and requirement count politely after typing pauses (1 s).
locale string 'en-US' Message and number-formatting locale.
Output Payload Description
(changed) PasswordStrengthMeterChangeDetail The rating or a requirement changed after user input. Re-emits aui-change.

Call them through a viewChild query or a template reference.

Method Description
attach(target: PasswordStrengthTarget): void Follow an input.
detach(): void Stop following the input.

Pattern: Text rating plus a native list of requirements with state in text; a polite live region for debounced summaries. The segmented bar is aria-hidden (the text carries the meaning).

The Angular component renders the framework-neutral component, so its keyboard support, roles, WCAG 2.2 criteria, budgets, and import cost apply unchanged: see Password Strength Meter: Accessibility and performance.