YuhuanStudioYunUIDocs
Forms & Inputs

Password Input

A password field with a built-in reveal toggle and wired-up error messaging.

A password field with a reveal toggle built in.

Import

tsx
1import { PasswordInput } from "@yuhuanowo/yunui";

Usage

It forwards every <input> attribute, so it drops into a form exactly where a plain <Input type="password"> would — controlled or uncontrolled, with name, autoComplete, required and the rest.

Password input

Passwords do not match.

Notes

  • The toggle is a flex sibling of the input, not an absolutely-positioned overlay. Safari mis-placed the absolute version outside the field; the flex row renders identically everywhere.
  • The toggle is tabIndex={-1}, so tabbing through a sign-in form goes password → submit, without a detour through a button that only changes what you can see.
  • It carries aria-pressed and a label that flips between show/hide — override the English defaults with labels={{ show, hide }}.
  • error sets aria-invalid and links the message with aria-describedby.

Props

PropTypeDefaultDescription
errorstringError message shown below the field; also switches the border to a red error style.
labels{ show?: string; hide?: string; } | undefinedAccessible labels for the reveal toggle (English defaults).

On this page