- Accordion
- Action BarUpdated
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- BadgeUpdated
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- CalendarUpdated
- CardUpdated
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context MenuUpdated
- Data List
- Date Picker
- DialogUpdated
- DrawerUpdated
- Editable
- FieldUpdated
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- MarqueeUpdated
- Menu
- Native Select
- Number InputUpdated
- Pagination
- Password InputNew
- Popover
- Progress
- Prose
- QR Code
- Radio Group
- Rating
- Resizable
- Scroll Area
- Segment Group
- Select
- Separator
- Sheet
- Sidebar
- Signature Pad
- Skeleton
- Skip Nav
- Slider
- Spinner
- Status
- Steps
- Switch
- TableUpdated
- Tabs
- Textarea
- TimerUpdated
- ToastUpdated
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View
Installation#
pnpm dlx shadcn@latest add @shark/password-input
Anatomy#
PasswordInput └── PasswordInputGroup ├── PasswordInputInput └── PasswordInputTrigger
Usage#
import { PasswordInput, PasswordInputGroup, PasswordInputInput, PasswordInputTrigger, } from "@/components/ui/password-input";
<PasswordInput> <PasswordInputGroup> <PasswordInputInput placeholder="Enter password" /> <PasswordInputTrigger /> </PasswordInputGroup> </PasswordInput>
Controlled#
Use value and onChange on PasswordInputInput to control the password value.
Character count: 0
States#
Disabled#
Use the disabled prop to disable the password input.
The field is currently disabled.
Invalid#
Use the invalid prop to mark the password input as invalid.
Please enter a valid password.
Sizes#
Use the size prop to change the input height.
Small#
Medium#
Large#
Examples#
Autocomplete#
Use the autoComplete prop to hint autofill behavior to the browser.
current-password— signing in with an existing passwordnew-password— creating or resetting a password
For signing in to an existing account.
For creating or resetting a password.
Controlled Visibility#
Use visible and onVisibilityChange to control whether the value is shown.
Auto Hide#
Use visible, onVisibilityChange, and a timer to hide the password again after it is revealed.
Custom Indicator#
With Field#
Combine with Field components, for labeled password fields with helper text.
Must be at least 8 characters.
API Reference#
PasswordInput#
Root component. Manages visibility and input state.
| Prop | Type | Default |
|---|---|---|
size | "sm" | "md" | "lg" | "md" |
autoComplete | "current-password" | "new-password" | "current-password" |
defaultVisible | boolean | false |
visible | boolean | - |
disabled | boolean | - |
invalid | boolean | - |
readOnly | boolean | - |
required | boolean | - |
name | string | - |
ignorePasswordManagers | boolean | - |
onVisibilityChange | (details: VisibilityChangeDetails) => void | - |
className | string | - |
asChild | boolean | false |
PasswordInputGroup#
Wraps the input and visibility trigger.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
PasswordInputInput#
Password field.
| Prop | Type | Default |
|---|---|---|
size | "sm" | "md" | "lg" | "md" |
className | string | - |
asChild | boolean | false |
PasswordInputTrigger#
Button that toggles visibility.
| Prop | Type | Default |
|---|---|---|
className | string | - |
PasswordInputIndicator#
Renders different icons based on visibility. Use fallback for the hidden state and pass the visible-state icon as children.
| Prop | Type | Default |
|---|---|---|
fallback | React.ReactNode | <EyeOffIcon /> |
children | React.ReactNode | <EyeIcon /> |
className | string | - |
For a complete list of props, see the Ark UI documentation.