v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS

PasswordInput

Password entry with an accessible visibility toggle.

Interactive preview

Use a unique password for this workspace.

Usage

import { PasswordInput, Label } from "@devvy-ui/react";

<Label htmlFor="password">Password</Label>
<PasswordInput id="password" name="password" autoComplete="new-password" />

API reference

Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:

PropTypeDefaultDescription
showLabel / hideLabelstringShow password / Hide passwordAccessible toggle names.
value / defaultValue / autoCompletenative input props—Password value and credential autofill.

Accessibility & behavior

Platform Behavior & Guidelines

The ref and native attributes target the input. A native non-submit toggle exposes aria-controls and aria-pressed, with disabled state matching the input. Keep a visible label and use an appropriate autocomplete value. Revealing changes presentation only; validation remains native/application-owned.

Source ownership

Run npx @devvy-ui/cli init once in your React project, then add the source:

npx @devvy-ui/cli add password-input

Make the source yours.

Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.

PasswordInput.tsxREACT / TSX

Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.