UsePasswordInputResult
Properties
Section titled “Properties”capsLock
Section titled “capsLock”capsLock: boolean;Caps Lock is on and capsLockWarning is enabled.
captureSelection
Section titled “captureSelection”captureSelection: () => void;Wire to the toggle’s onMouseDown so the caret survives the reveal.
Returns
Section titled “Returns”void
checking
Section titled “checking”checking: boolean;A checkCompromised call is in flight.
clear: () => void;Empty the field. Present on every input hook in the suite.
Returns
Section titled “Returns”void
compromised
Section titled “compromised”compromised: boolean | null;true / false once checkCompromised resolves, null before that.
disabled
Section titled “disabled”disabled: boolean;handleBlur
Section titled “handleBlur”handleBlur: (event) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | FocusEvent<HTMLElement> |
Returns
Section titled “Returns”void
handleFocus
Section titled “handleFocus”handleFocus: (event) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | FocusEvent<HTMLElement> |
Returns
Section titled “Returns”void
handleModifierEvent
Section titled “handleModifierEvent”handleModifierEvent: (event) => void;Wire to the input’s onKeyDown/onKeyUp to keep the Caps Lock flag live.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | | KeyboardEvent<HTMLElement> | MouseEvent<HTMLElement, MouseEvent> |
Returns
Section titled “Returns”void
ids: object;Stable ids for the input and each piece of describing text.
announcement
Section titled “announcement”announcement: string;capsLock
Section titled “capsLock”capsLock: string;compromised
Section titled “compromised”compromised: string;input: string;label: string;Only referenced when label is a node rather than a string.
rules: string;strength
Section titled “strength”strength: string;inputRef
Section titled “inputRef”inputRef: object;Structural rather than RefObject: in @types/react 18 RefObject.current
is readonly, in 19 it is mutable. Declaring the shape keeps this assignable
under both, which matters because react >= 18 is a peer.
current
Section titled “current”current: HTMLInputElement | null;maxLength
Section titled “maxLength”maxLength: number;maxLength after coercion. Always set — an unusable value falls back to the default.
minLength
Section titled “minLength”minLength: number;minLength after coercion — also what the default length rule uses.
revealed
Section titled “revealed”revealed: boolean;The password is currently rendered as plain text.
rules: PasswordRuleState[];Every rule with its met flag.
setRevealed
Section titled “setRevealed”setRevealed: (next) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
next | boolean |
Returns
Section titled “Returns”void
setValue
Section titled “setValue”setValue: (next) => void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
next | string |
Returns
Section titled “Returns”void
strength
Section titled “strength”strength: PasswordStrength;The estimator’s verdict for the current password.
toggleReveal
Section titled “toggleReveal”toggleReveal: () => void;Returns
Section titled “Returns”void
type: "password" | "text";'text' when revealed, 'password' otherwise.
valid: boolean;All required rules met, minScore reached, and not known-compromised.
value: string;The current password.