Loading preview
Floating Label Input
InputsA text field whose label sits inside and floats above on focus or when filled.
A lock-screen passcode keypad that shakes on a wrong code and unlocks on the right one.
npx shadcn@latest add @venusui/passcode-padRun 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/passcode-pad.tsxThe code behind the preview above.
passcode-pad-demo.tsx
"use client"
import { PasscodePad } from "@/components/ui/passcode-pad"
export default function PasscodePadDemo() {
return (
<div className="flex flex-col items-center gap-6">
<PasscodePad onSubmit={(code) => code === "2580"} />
<p className="text-xs text-muted-foreground">Hint: the passcode is 2580</p>
</div>
)
}
| Prop | Type | Default | Description |
|---|---|---|---|
| length | number | 4 | Number of digits. |
| onSubmit | (code: string) => boolean | Promise<boolean> | — | Checks a complete code; return true to unlock. |
| title | string | "Enter passcode" | Heading above the dots. |
| successMessage | string | "Unlocked" | Shown once unlocked. |
All <div> props.
lucide-react for the lock icons. React 19 and Tailwind CSS v4.onSubmit (it can be async); never ship the real code to the browser.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.