Password Input
This component is specifically designed for securely entering passwords. It includes built-in functionality to toggle password visibility, allowing users to show or hide the entered text. The component features a login icon and an eye icon (open/closed) that users can click to switch between masked and visible password states, enhancing both usability and security.
How To Use
Using this component is as simple as working with any standard input field in a form. After installation, import the component and place it within your form structure.
Usage Restriction
This component is designed to work exclusively within the Form component provided by shadcn/ui. Make sure you wrap it inside a valid Form context to ensure proper functionality.
Update global.css
Add the following CSS to your global or main stylesheet. It is used to hide the default eye icon that appears in the native password field, ensuring full control over custom visibility toggles.
Preview
Accepted Props
This component accepts all standard input
props except for the type
prop. The type is internally managed by the component to ensure correct functionality (e.g., for password visibility toggling or other controlled behaviors).
Dependencies
- Form: This component relies on the
Form
component from shadcn/ui for proper integration with form handling and submission. View Form Documentation