Skip to content

UI: PasswordField

View as Markdown

A password input with a button that shows or hides the password. Import the token file once (@pithyx/ui/tokens.css) and wrap the app in UiProvider; see @pithyx/ui.

Generated from the TSDoc comments of @pithyx/ui 1.0.0-rc.9 at build time; the text below the headings is the comment in the source.

The props of PasswordField; autoComplete tells password managers what to do.

label: ReactNode;

The visible label, also the accessible name.

TextFieldProps.label

optional description?: ReactNode;

A hint below the input, announced with it.

TextFieldProps.description

optional errorMessage?: ReactNode;

The text shown while the field is invalid (isInvalid or a failed validate).

TextFieldProps.errorMessage

optional placeholder?: string;

A hint inside the empty input; never a replacement for the label.

TextFieldProps.placeholder

optional className?: string;

Extra class names for the field, added after its own.

TextFieldProps.className

optional inputClassName?: string;

Extra class names for the input element.

TextFieldProps.inputClassName

optional autoCapitalize?: "none" | "characters";

“none” for user names and codes, so phones do not capitalize the first letter.

Omit.autoCapitalize;
autoComplete: 'current-password' | 'new-password';

current-password to sign in, new-password to set one.

Omit.autoComplete;
function PasswordField(props): Element;

A password input with a button that shows or hides the password. The button’s label comes from the package’s own texts in the language of the nearest UiProvider.

Parameter Type Description
props PasswordFieldProps The props of TextField without type and trailing, plus the required autoComplete.

Element

The password field.