FormComponentsPassword Field

Password Field

PasswordField is a specialized reusable input component for Shaddy Form.

⚠️ This content is not available in your language yet.

PasswordField is a specialized reusable input component for Shaddy Form. It supports labels, required state, password visibility toggle, custom icons, and more. Use it inside a Shaddy Form to collect password input with validation.

Installation

pnpm dlx shadcn@latest add https://shaddy-docs.vercel.app/r/password-field

Props

NameTypeDefaultDescription
namestring (from react-hook-form Path)requiredThe field name (must match your form schema).
labelstringThe label displayed above the input.
placeholderstring"Enter password"Placeholder text for the input.
requiredbooleanfalseMarks the field as required.
classNamestringAdditional CSS classes for the field container.
iconbooleantrueWhether to show the password visibility toggle icon.
showIconReactNode<Eye />Icon to display for "show password".
hideIconReactNode<EyeOff />Icon to display for "hide password".

Usage

<ShaddyForm>
  <PasswordField
    name="password"
    label="Password"
    required
    placeholder="Enter your password"
  />
</ShaddyForm>