Documentation Index
Fetch the complete documentation index at: https://mintlify.com/rijvi-mahmud/shaddy/llms.txt
Use this file to discover all available pages before exploring further.
PasswordField is a specialised text input for collecting passwords inside ShaddyForm. It renders a shadcn/ui Input set to type="password" by default and includes a built-in visibility toggle button on the right side. Clicking the toggle switches the input between masked and plain-text modes. The toggle icons are fully replaceable, and the toggle itself can be hidden if you prefer a plain password input.
Installation
Install all ShaddyForm fields at once with theshaddy-form registry item:
Usage
Props
The field name. Must match a key in your Zod schema passed to
ShaddyForm.Label text rendered above the input. Omit to hide the label.
Placeholder text shown inside the input when it is empty.
When
true, appends a red asterisk to the label as a visual indicator.When
true (the default), the visibility toggle button is rendered on the right side of the input. Set to false to render a plain password input without a toggle.The icon rendered inside the toggle button when the password is currently hidden (i.e., clicking it will reveal the password).
The icon rendered inside the toggle button when the password is currently visible (i.e., clicking it will mask the password).
Additional CSS classes applied to the outermost
FormItem wrapper.Notes
- The visibility toggle button uses
tabIndex={-1}so it does not interfere with keyboard tab navigation through the form. - The toggle button carries an
aria-labelof"Show password"or"Hide password"depending on the current state, keeping the control accessible. - Password validation (length, complexity, etc.) is handled entirely by your Zod schema —
PasswordFieldmakes no assumptions about rules. PasswordFieldmust be rendered inside a<ShaddyForm>— it readscontrolfromuseFormContextinternally.