A shadcn-style password input component built with Ark UI primitives.

Installation

npx shadcn@latest add @ark-cn/password-input

Usage

import * as PasswordInput from "@/components/ui/password-input"

Read exported parts in src/components/ui/password-input.tsx and compose the primitive according to the Ark UI pattern for this component.

Examples

Default

Autocomplete

Controlled visibility

Controlled visible: false

Root provider

usePasswordInput + PasswordInputRootProvider - visible false

With field

Field label and helper text around the password input.

Ignore password managers

Strength meter

Type to measure strength.

Validation

Enter 8+ characters (invalid while too short).

Context

Context: password is masked

Translations

API reference

This component mirrors the upstream Ark UI primitive. All props and DOM behavior are defined by Ark unless you see an ark-cn-only row below.

PasswordInput

PropTypeDescription
startAddon?ReactNodeSlot before the input.
endAddon?ReactNodeSlot after the input.
variant?ButtonVariantButton style for the visibility toggle (default ghost).
size?ButtonSizeButton size for the visibility toggle (default icon-xs).
hideVisibilityToggle?booleanRemoves the eye toggle from the end addon.

See the ARK UI documentation for the full API.