Loading preview
Floating Label Input
InputsA text field whose label sits inside and floats above on focus or when filled.
A password field with a show/hide toggle and an optional strength meter.
npx shadcn@latest add @venusui/password-inputRun this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.
Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.
@/components/ui/password-input.tsxThe code behind the preview above.
password-input-demo.tsx
import { PasswordInput } from "@/components/ui/password-input"
export default function PasswordInputDemo() {
return (
<div className="w-full max-w-sm space-y-2">
<label htmlFor="new-password" className="text-sm font-medium">
New password
</label>
<PasswordInput id="new-password" autoComplete="new-password" showStrength />
</div>
)
}
| Prop | Type | Default | Description |
|---|---|---|---|
| showStrength | boolean | false | Show a four-step meter and a hint under the field. |
All <input> props except type. Works controlled (value + onChange) or uncontrolled.
lucide-react for the eye icons, React 19 and Tailwind CSS v4.scorePassword is exported. Replace it with your own rules (or a library such as zxcvbn) to match your policy.autoComplete="new-password" on sign-up and "current-password" on sign-in so password managers help.aria-pressed.aria-describedby and announced politely as it changes.Unknown registry "@venusui"npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.No components.json foundnpx shadcn@latest init in your project first.A text field whose label sits inside and floats above on focus or when filled.
A number field with minus and plus buttons, clamped to a range.
One-time code entry in separate boxes with paste, autofill and keyboard navigation.