PasswordStrength handbook
v1.0.0 · @snowui-design-system/components
Introduction
Evaluate password strength immediately with a four-segment indicator and labels. The component does not persist or transmit passwords, write them to the DOM or event results, handle password input, enforce account policy, or submit forms.
Usage choices
Pass the current input value. The default heuristic returns 0 for an empty value and 1 below minimumLength (8 by default); at or above the minimum, it rates the four character categories from 1 to 4. The default requirement is only the minimum length; optional character requirements have specific guidance. It does not check breached or common passwords or guarantee security. Override evaluate and labels as needed.
Quick start
API
Also exports evaluatePasswordStrength, PasswordStrengthLevel, and PasswordStrengthEvaluator. Other compatible Props are inherited from Frame; the component owns children, row, column, gap, and enableAutoLayout.
Usage boundaries and details
By default only a minimum of eight characters is required. An empty value shows its level label. For non-empty values below minimumLength, show the length hint first; after it is reached, identify missing lowercase, uppercase, number, and symbol requirements before showing the strength label. These requirements do not replace server-side validation. Four segments are 4px high with 8px gaps; gap and radius use the public --snowui-password-strength-segment-gap-override and --snowui-password-strength-segment-radius-override variables. The indicator and text are inset 4px on each side; the caller provides a 16px gap from the input, labels the input, and associates the result with aria-describedby. The component has no interaction, timers, or motion and supports server rendering. Custom evaluators receive the password and must not persist or send it.
Use in AI conversations
Use the public evaluator and labels to show strength; the host owns the input, state, and submission. The component does not read accounts or send requests. Do not ask AI for, log, or transmit real passwords. If the host cannot safely handle password input, use text guidance instead. Real conversation hosts have not been verified.
PasswordStrength style overrides
Prefer public Props. If customization is needed, use your own class or instance style according to the styling guide. Check the scope of public overrides and do not modify private DOM. Choose tokens by category; external applications need not install first-party utilities.
PasswordStrength types and states
Required Props: none.
Two-way binding: this component declares no named binding; state updates are handled by its public callbacks or host.
Inherited: Omit<FrameProps, 'children' | 'column' | 'row' | 'gap' | 'enableAutoLayout'>. See the base component’s public documentation; omitted fields are excluded.
Shared Frame API · Return to API
The declarations below are referenced by public Props and extracted from source. Svelte Snippet denotes content, and ComponentProps denotes a component’s Props.
PasswordStrengthEvaluator
Source: components/src/components/PasswordStrength.svelte
PasswordStrengthLevel
Source: components/src/components/PasswordStrength.svelte