CarsXE

Search docs

Search pages, components, and skills.

Password Input

A password field with a visibility toggle and an optional strength meter. feedback opens a panel below the focused input rating the value weak, medium, or strong; the labels, the rating logic, and the panel's header and footer are all replaceable.

Installation

Import from the package. Do not run shadcn add in your app.

tsx
import { PasswordInput } from "@carsxe/design-system/components/password-input"

Usage

tsx
import { PasswordInput } from "@carsxe/design-system/components/password-input"

<PasswordInput placeholder="Password" feedback />

Strength feedback

Custom labels and suggestions

Custom strength logic

States

API Reference

PropTypeDefault
feedbackbooleanfalse
getStrength(value: string) => "weak" | "medium" | "strong" | undefinedgetPasswordStrength
promptLabelReact.ReactNode"Enter a password"
weakLabelReact.ReactNode"Weak"
mediumLabelReact.ReactNode"Medium"
strongLabelReact.ReactNode"Strong"
feedbackHeaderReact.ReactNode—
feedbackFooterReact.ReactNode—
toggleMaskbooleantrue
showIconReact.ReactNode<EyeIcon />
hideIconReact.ReactNode<EyeOffIcon />
visibleboolean—
defaultVisiblebooleanfalse
onVisibleChange(visible: boolean) => void—