BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/neon-ui/auth-form

AuthForm

neon-ui/auth-form
FreeComponent

The email/password card: mode switching, providers, structured errors, and a working state — Better Auth-shaped.

Install it

npx shadcn@latest add https://ui.neon.com/r/auth-form.json

Source

src/components/auth-form/auth-form.tsxui.neon.com/r/auth-form.json · first 6 KB
1"use client";
2
3import type { ComponentProps, FocusEvent, FormEvent, ReactNode } from "react";
4import { useEffect, useId, useRef, useState } from "react";
5import { createPortal } from "react-dom";
6
7import { Button } from "@/components/ui/button";
8import { cn } from "@/lib/utils";
9
10export type AuthMode = "sign-in" | "sign-up" | "reset";
11
12export type AuthFieldName = "name" | "email" | "password";
13
14/** Returns the failure message, or null when the value passes. */
15export type AuthValidator = (value: string) => string | null;
16
17export interface AuthProvider {
18 id: string;
19 label: string;
20 icon?: ReactNode;
21}
22
23export interface AuthFormValues {
24 email: string;
25 password: string;
26 /** Present in sign-up mode. */
27 name?: string;
28}
29
30export type AuthFormProps = Omit<ComponentProps<"form">, "onSubmit"> & {
31 /** Which face the form shows. */
32 mode?: AuthMode;
33 /** Called with the field values once they pass validation. */
34 onSubmit: (values: AuthFormValues) => void;
35 /** Renders the footer swap link and enables mode switching. */
36 onModeChange?: (mode: AuthMode) => void;
37 /** Locks the fields and puts the action in its working state. */
38 isBusy?: boolean;
39 /** Structured failure message rendered above the action. */
40 error?: string | null;
41 /** Server-side verdicts pinned to fields (e.g. incorrect password). */
42 fieldErrors?: Partial<Record<AuthFieldName, string>>;
43 /**
44 * Per-field validators merged over the mode defaults — return the
45 * failure message, or null when the value passes. Use it to bring
46 * your own password policy.
47 */
48 validators?: Partial<Record<AuthFieldName, AuthValidator>>;
49 /** OAuth-style providers rendered under the divider. */
50 providers?: AuthProvider[];
51 /** Called with the provider id. */
52 onProvider?: (id: string) => void;
53 /** Renders the forgot link on the password row (sign-in only). */
54 onForgotPassword?: () => void;
55 /**
56 * The email a reset link was sent to. In reset mode this flips the
57 * form to its confirmation face.
58 */
59 resetSentTo?: string | null;
60 /** Renders the "send again" link on the confirmation face. */
61 onResend?: () => void;
62 /** Brand mark slot above the title. */
63 mark?: ReactNode;
64 title?: string;
65 description?: string;
66 /**
67 * "card" (default) draws the house surface — border, bg-card,
68 * padding. "bare" renders naked for split layouts that supply
69 * their own panel.
70 */
71 variant?: "card" | "bare";
72};
73
74// … truncated

What it pulls in

Other registry items

  • utils
  • https://ui.neon.com/r/neon-tokens.json
  • https://ui.neon.com/r/button.json

Files it writes

  • src/components/auth-form/auth-form.tsx

Facts

Registry
neon-ui
Type
registry:component
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

ui.neon.com neon-solutions/ui on GitHub Raw registry item This item as JSON

More from neon-ui

All 77 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
ActivityFeedactivity-feedneon-uiComponentsFree2 deps
AgentChatagent-chatneon-uiComponentsFree6 deps
AnimatedWashanimated-washneon-uiComponentsFreeno deps · 2 files
ApiKeyListapi-key-listneon-uiComponentsFree2 deps
AppCardapp-cardneon-uiComponentsFree2 deps
AppCreatorapp-creatorneon-uiComponentsFree2 deps
AutoscaleChartautoscale-chartneon-uiComponentsFree1 dep
Badgebadgeneon-uiComponentsFree2 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex