Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

PasswordInput

A password field in an application-owned sign-in form.

Preview

Live preview

Changes apply to this preview only.

At least 8 characters.

Not signed in

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Anatomy

A visible label, an optional description and the eye toggle.

Open preview

Sizes

From xs to xxl, matching the Input scale.

Open preview

Validation

An error message marks the field invalid, replaces the description and is announced as an alert.

Open preview

Usage

Keep authentication and password validation on the server; visibility is a local preference.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluPasswordInputProps

Type source
PimoluPasswordInputProps public API
NameTypeDefaultDescription
valuestring | undefined—Controlled value.
defaultValuestring | undefined—Initial value when uncontrolled.
onValueChange((value: string) => void) | undefined—Called with the next value on every keystroke.
size"xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined"md"Field size. Defaults to "md".
labelstring | undefined—Visible field label.
descriptionstring | undefined—Helper text shown below the field when there is no error.
errorstring | undefined—Error message; marks the field invalid and replaces the description.
invalidboolean | undefinedfalseMarks the field invalid without an error message.
showLabelstring | undefined"Show password"Accessible name of the toggle while the password is hidden.
hideLabelstring | undefined"Hide password"Accessible name of the toggle while the password is visible.
fullWidthboolean | undefinedfalseStretch the field to the width of its container.
containerClassNamestring | undefined—Class applied to the root wrapper.
placeholderstring | undefined—Public Pimolu prop; see the source declaration for details.
autoCompletestring | undefined—Public Pimolu prop; see the source declaration for details.
onChangeChangeEventHandler<HTMLInputElement, HTMLInputElement> | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
childrenReactNode—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLInputElement> | undefined—Standard React/HTML attribute.
disabledboolean | undefinedfalseStandard React/HTML attribute.
namestring | undefined—Standard React/HTML attribute.
requiredboolean | undefinedfalseStandard React/HTML attribute.
value

string | undefined

No default extracted.

Controlled value.

defaultValue

string | undefined

No default extracted.

Initial value when uncontrolled.

onValueChange

((value: string) => void) | undefined

No default extracted.

Called with the next value on every keystroke.

size

"xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined

Default: "md"

Field size. Defaults to "md".

label

string | undefined

No default extracted.

Visible field label.

description

string | undefined

No default extracted.

Helper text shown below the field when there is no error.

error

string | undefined

No default extracted.

Error message; marks the field invalid and replaces the description.

invalid

boolean | undefined

Default: false

Marks the field invalid without an error message.

showLabel

string | undefined

Default: "Show password"

Accessible name of the toggle while the password is hidden.

hideLabel

string | undefined

Default: "Hide password"

Accessible name of the toggle while the password is visible.

fullWidth

boolean | undefined

Default: false

Stretch the field to the width of its container.

containerClassName

string | undefined

No default extracted.

Class applied to the root wrapper.

placeholder

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

autoComplete

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

onChange

ChangeEventHandler<HTMLInputElement, HTMLInputElement> | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

children

ReactNode

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLInputElement> | undefined

No default extracted.

Standard React/HTML attribute.

disabled

boolean | undefined

Default: false

Standard React/HTML attribute.

name

string | undefined

No default extracted.

Standard React/HTML attribute.

required

boolean | undefined

Default: false

Standard React/HTML attribute.

Accessibility

  • Preserve autocomplete and label the reveal action without exposing the secret in feedback.
Read the accessibility guide →