Sign-in Form
A centered sign-in card with password show/hide that you connect to your auth provider.
Installation
npx shadcn@latest add @venusui/login-01Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.
Files added to your project
Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.
@/components/ui/password-input.tsxfrom password-input@/components/login-01.tsx
Also adds the shadcn button component if your project doesn't have it yet.
Usage
The code behind the preview above.
login-01-demo.tsx
import { Login01 } from "@/components/login-01"
export default function Login01Demo() {
return <Login01 />
}
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| onSubmit | (credentials: { email: string; password: string }) => Promise<void> | void | — | Signs the user in. Throw an Error with a message to show it. Without it, submitting says the form isn’t connected. |
Only the prop above.
Requirements
- shadcn
buttonand VenusUIpassword-input. The CLI installs both.
Customization
- Connect it to Supabase, Auth.js or your own API in
onSubmit, and redirect on success. - Never log or store passwords yourself; let your auth provider handle them.
Accessibility
- Labelled fields with correct
autocompletevalues; errors are announced through a status region.
Troubleshooting
- Submitting says the form isn’t connected.
- Pass an
onSubmithandler. The block never pretends to sign anyone in. Unknown registry "@venusui"- Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (
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 found- Run
npx shadcn@latest initin your project first.