structyl

Password Toggle Field

stable

A password input with a show / hide toggle.

Basic usage

Examples

With label and strength hint

Wrap in a field layout and add a password strength message.

Use at least 8 characters with letters and numbers.

Password form field

Combine the root, input and toggle parts with labels and helper text.

Use at least 12 characters.

Features

  • Accessible visibility toggle.
  • Controlled or uncontrolled.

Installation

bash
pnpm dlx structyl add password-toggle-field

API Reference

PasswordToggleField.Root

A password input with a visibility toggle.

PropTypeDefault
visibleboolean

Controlled visibility.

onVisibleChange(visible: boolean) => void

Called when visibility changes.

PasswordToggleField.Input

The password input.

PropTypeDefault

PasswordToggleField.Toggle

The show / hide button.

PropTypeDefault
Password Toggle Field | structyl