Rxova
Skip to content

PasswordInputProps

optional aria-describedby?: string;

ids of external error/help text. Merged with the ids this component owns.


optional aria-label?: string;

Accessible name, when there is no visible text to point label at. Wins over label if both are given.


optional autoComplete?: string;

Password managers key off this.

‘current-password’ Set 'new-password' on sign-up and change-password forms.


optional autoFocus?: boolean;

Focus the field on mount.

false

optional blocklist?: string[];

Extra low-entropy strings to reject, e.g. your product name.


optional capsLockLabel?: ReactNode;

Text of the Caps Lock warning.

'Caps Lock is on'

optional capsLockWarning?: boolean;

Warn while Caps Lock is on.

true

optional checkCompromised?: (password, signal) => Promise<boolean>;

Optional async check against a breach corpus. Called debounced, with an AbortSignal that fires when the password changes again or the component unmounts. The library never makes a network request itself — wire this to a k-anonymity endpoint (or your own service) and keep the plaintext local.

ParameterType
passwordstring
signalAbortSignal

Promise<boolean>


optional checkCompromisedDelay?: number;

Debounce before checkCompromised runs, in ms.

400

optional className?: string;

optional compromisedLabel?: ReactNode;

Message shown when checkCompromised resolves true.

a stock sentence

optional defaultRevealed?: boolean;

Initial reveal state for the uncontrolled case.

false

optional defaultValue?: string;

Uncontrolled initial password. Ignored when value is provided.


optional disabled?: boolean;

optional estimate?: (password) => PasswordStrength;

Swap the built-in estimator — pass a zxcvbn adapter here if you want its wordlists and are willing to pay ~350 kB (minified + brotli) for them.

ParameterType
passwordstring

PasswordStrength

the built-in estimateStrength


optional hideOnBlur?: boolean;

Re-mask when focus leaves the field, so a revealed password does not sit on screen after the user tabs away.

true

optional hideRevealToggle?: boolean;

Drop the reveal button entirely.

false

optional id?: string;

Base id; the input, meter, checklist and warnings derive ids from it.


optional invalid?: boolean;

Sets aria-invalid and data-invalid on the field.


optional label?: ReactNode;

Accessible name for the field. Not rendered — supply your own visible <label htmlFor={${id}-input}> when the design calls for one, exactly as every other input in the suite expects. A node is exposed through a hidden element, since aria-label only takes a string.


optional maxLength?: number;

Native maxlength. There is always a cap — an unbounded field lets a single paste drive unbounded estimator and KDF work — and this prop only moves it. NIST SP 800-63B requires accepting at least 64 characters, so the default sits at double that; a value below minLength is unsatisfiable and falls back to the default rather than removing the cap.

128

optional minLength?: number;

Minimum length for the default rule and the native minlength.

8

optional minScore?:
| PasswordScore
| null;

Minimum score to count as valid. null disables the gate.

null

optional name?: string;

optional onBlur?: (event) => void;
ParameterType
eventFocusEvent<HTMLElement>

void


optional onChange?: (value) => void;
ParameterType
valuestring

void


optional onFocus?: (event) => void;
ParameterType
eventFocusEvent<HTMLElement>

void


optional onRevealChange?: (revealed) => void;
ParameterType
revealedboolean

void


optional onValidityChange?: (valid) => void;

Fires whenever overall validity changes — all required rules met and minScore reached.

ParameterType
validboolean

void


optional onWarn?: (warning) => void;

Called in development whenever a prop is coerced or a configuration looks wrong — see PasswordWarning. The coerced result still renders, so this never changes what the user sees. When omitted, the same warnings go to console.warn. The entire path is stripped from production builds.

ParameterType
warningPasswordWarning

void


optional placeholder?: string;

optional readOnly?: boolean;

optional required?: boolean;

optional revealed?: boolean;

Controlled reveal state. Omit to let the component own it.


optional revealIcon?: ReactNode | ((state) => ReactNode);

Custom reveal-button contents.

a built-in eye glyph

optional revealLabel?: string | ((state) => string);

Accessible name for the reveal button.

'Show password' / 'Hide password'

optional rules?: PasswordRule[];

NIST SP 800-63B leads with length and explicitly advises against composition rules, so the default is a single length rule. Pass your own array to opt into more.


optional showRules?: boolean;

Render the requirement checklist.

rules was provided


optional showStrength?: boolean;

Render the strength meter.

false

optional strengthLabel?: (strength) => ReactNode;

Label under the meter for a score.

ParameterType
strengthPasswordStrength

ReactNode

'Very weak''Strong'

optional style?: CSSProperties;

optional userInputs?: string[];

Values the user has already typed elsewhere — email, username, name. A password containing any of them is penalised. Nothing leaves the browser.


optional value?: string;

Controlled password.