Password API

API documentation for Password component

PasswordRoot#

Props#

State#

Exposes#

Events#

Interfaces#

Types#

PasswordInput#

Props#

Exposes#

Interfaces#

Types#

PasswordStrength#

Props#

Exposes#

Interfaces#

Types#

PasswordMeter#

Props#

Exposes#

Interfaces#

Types#

PasswordPortal#

Props#

Exposes#

Interfaces#

Types#

PasswordClearIcon#

Props#

Exposes#

Interfaces#

Types#

usePassword#

Props#

Props for the usePassword hook.

nametypedefaultdescription
valuestring
null
The controlled value of the password input.
defaultValuestring
null
The default value for uncontrolled mode.
maskboolean
null
The controlled mask state of the password input. When true, the password is hidden. When false, the password is visible.
defaultMaskboolean
null
The default mask state for uncontrolled mode.
onValueChange(event: usePasswordValueChangeEvent) => void
null
Callback fired when the password value changes.
onMaskChange(event: usePasswordMaskChangeEvent) => void
null
Callback fired when the mask state changes.

State#

Defines valid state in usePassword.

nametypedefaultdescription
valuestring
null
Current password value.
maskboolean
null
Whether the password is masked.

Exposes#

Defines the methods and properties exposed by usePassword.

nametypedefaultdescription
stateusePasswordState
null
The state of the usePassword.
onInputChange(event: ChangeEvent<HTMLInputElement>) => void
null
Handle input change.
toggleMask() => void
null
Toggle the mask state of the password.

Events#

Event object for value change callback.

nametypedescription
valuestringThe new password value.
originalEventEThe original DOM event.

Event object for mask change callback.

nametypedescription
valuebooleanWhether the password is masked.

Types#

Instance of usePassword headless.

values
HeadlessInstance<usePasswordProps, usePasswordState, usePasswordExposes>