BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/better-auth-ui/auth

Auth

better-auth-ui/auth
FreeComponent

A unified authentication component that renders the appropriate auth view based on path or view prop.

Live preview

live · rendered by the registry
Rendered by better-auth-ui on their own page — this is the component running, not a screenshot of it.

Install it

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

Source

src/components/auth/auth.tsxbetter-auth-ui.com/r/auth.json
1"use client"
2
3import type { AuthView } from "@better-auth-ui/core"
4import { useAuth } from "@better-auth-ui/react"
5import { type ComponentType, useEffect } from "react"
6
7import { AuthRedirect } from "./auth-redirect"
8import { ForgotPassword } from "./forgot-password"
9import type { SocialLayout } from "./provider-buttons"
10import { ResetLinkSent } from "./reset-link-sent"
11import { ResetPassword } from "./reset-password"
12import { SignIn } from "./sign-in"
13import { SignOut } from "./sign-out"
14import { SignUp } from "./sign-up"
15import { VerifyEmail } from "./verify-email"
16
17export type AuthProps = {
18 className?: string
19 path?: string
20 socialLayout?: SocialLayout
21 socialPosition?: "top" | "bottom"
22 /** @remarks `AuthView` */
23 view?: AuthView
24}
25
26/**
27 * Built-in views that only make sense when email + password auth is enabled.
28 * When it's disabled, the `<Auth>` router redirects these to `signIn` so a
29 * plugin's `fallbackViews.auth.signIn` (e.g. magic link) takes over.
30 */
31const PASSWORD_ONLY_VIEWS = [
32 "signUp",
33 "forgotPassword",
34 "resetPassword",
35 "resetLinkSent"
36]
37
38const AUTH_VIEWS: Partial<Record<AuthView, ComponentType<AuthProps>>> = {
39 redirect: AuthRedirect,
40 signIn: SignIn,
41 signOut: SignOut,
42 signUp: SignUp,
43 forgotPassword: ForgotPassword,
44 resetPassword: ResetPassword,
45 resetLinkSent: ResetLinkSent,
46 verifyEmail: VerifyEmail
47}
48
49/**
50 * Render the appropriate authentication view based on the provided `view` or `path`.
51 *
52 * Resolution order:
53 * 1. Plugin overrides (`plugin.views.auth[currentView]`) — first registered wins.
54 * 2. Plugin fallbacks (`plugin.fallbackViews.auth.signIn`) when password auth is off.
55 * 3. Built-in views.
56 *
57 * @param path - Route path used to resolve an auth view when `view` is not provided
58 * @param socialLayout - Social layout to apply to sign-in/sign-up/magic-link views
59 * @param socialPosition - Position for social buttons (`"top"` or `"bottom"`)
60 * @param view - Explicit auth view to render (e.g., `"signIn"`, `"signUp"`)
61 * @returns The React element for the resolved authentication view
62 */
63export function Auth({
64 className,
65 path,
66 socialLayout,
67 socialPosition,
68 view
69}: AuthProps) {
70 const { basePaths, emailAndPassword, plugins, viewPaths, navigate } =
71 useAuth()
72
73 if (!view && !path) {
74 throw new Error("[Better Auth UI] Either `view` or `path` must be provided")
75 }
76
77 const authView =
78 view ||
79 (Object.keys(viewPaths.auth) as AuthView[]).find(
80// … truncated

What it pulls in

npm packages

  • @better-auth-ui/react@latest
  • @better-auth-ui/core@latest

Other registry items

  • https://better-auth-ui.com/r/radix-nova/auth-provider.json
  • https://better-auth-ui.com/r/radix-nova/sign-in.json
  • https://better-auth-ui.com/r/radix-nova/sign-up.json
  • https://better-auth-ui.com/r/radix-nova/forgot-password.json
  • https://better-auth-ui.com/r/radix-nova/reset-password.json
  • https://better-auth-ui.com/r/radix-nova/verify-email.json
  • https://better-auth-ui.com/r/radix-nova/auth-redirect.json
  • https://better-auth-ui.com/r/radix-nova/sign-out.json

Files it writes

  • src/components/auth/auth.tsx

Facts

Registry
better-auth-ui
Type
registry:component
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-02
Last confirmed
today

Go to the source

Docs on better-auth-ui better-auth-ui.com better-auth-ui/better-auth-ui on GitHub Raw registry item This item as JSON

More from better-auth-ui

All 49 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Account Settingsaccount-settingsbetter-auth-uiComponentsFree2 deps
Active Sessionsactive-sessionsbetter-auth-uiComponentsFree5 deps · 2 files
Additional Fieldadditional-fieldbetter-auth-uiComponentsFree5 deps
Adminadminbetter-auth-uiComponentsFree4 deps · 3 files
Anonymousanonymousbetter-auth-uiComponentsFree4 deps · 3 files
API Keyapi-keybetter-auth-uiComponentsFree4 deps · 10 files
Auth Providerauth-providerbetter-auth-uiComponentsFree4 deps · 2 files
Auth Redirectauth-redirectbetter-auth-uiComponentsFree3 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