Password Input
tetra-ui/password-inputFreeComponent
An input component that allows users to enter a password.
Live preview
live · rendered by the registry
Rendered by tetra-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://tetra-ui.com/r/password-input.jsonSource
1import { useState } from "react";2import { EyeIcon, EyeOffIcon } from "./icons";3import { InputAddon, InputAddonButton, InputAddonButtonIcon } from "./input";4import { TextInput, type TextInputProps } from "./text-input";56// Types7export type PasswordInputProps = Omit<8 TextInputProps,9 "rightElement" | "secureTextEntry"10>;1112// Components13export const PasswordInput = ({14 onFocus,15 onBlur,16 disabled,17 ...props18}: PasswordInputProps) => {19 const [isSecureEntry, setIsSecureEntry] = useState(true);2021 const Icon = isSecureEntry ? EyeOffIcon : EyeIcon;2223 return (24 <TextInput25 {...props}26 disabled={disabled}27 onBlur={onBlur}28 onFocus={onFocus}29 secureTextEntry={isSecureEntry}30 >31 <InputAddon align="inline-end">32 <InputAddonButton33 disabled={disabled}34 onPress={() => setIsSecureEntry((p) => !p)}35 size="icon"36 variant="ghost"37 >38 <InputAddonButtonIcon>39 <Icon />40 </InputAddonButtonIcon>41 </InputAddonButton>42 </InputAddon>43 </TextInput>44 );45};
What it pulls in
Other registry items
Files it writes
More from tetra-ui
All 41 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | tetra-ui | Components | Free | 1 dep | |
| Action Inputaction-input | tetra-ui | Components | Free | no deps | |
| Alertalert | tetra-ui | Components | Free | no deps | |
| Avataravatar | tetra-ui | Components | Free | no deps | |
| Badgebadge | tetra-ui | Components | Free | no deps | |
| Bottom Sheetbottom-sheet | tetra-ui | Components | Free | 4 deps · 7 files | |
| Buttonbutton | tetra-ui | Components | Free | no deps | |
| Cardcard | tetra-ui | Components | Free | no deps |
