BETTER-AUTH. UI
Components

<Auth />

Renders the Solid auth component for the current path or explicit view.

Usage

import { Auth } from "@/components/auth/auth"

export function AuthDemo() {
  return <Auth view="signIn" />
}

Built-in views

viewDefault path
callback/auth/callback
error/auth/error
redirect/auth/redirect
signIn/auth/sign-in
signUp/auth/sign-up
signOut/auth/sign-out
forgotPassword/auth/forgot-password
resetPassword/auth/reset-password
resetLinkSent/auth/reset-link-sent
verifyEmail/auth/verify-email

Registered plugins can contribute more views through their own viewPaths.auth, such as magicLink and magicLinkSent.

Callback results

Set Better Auth onAPIError.errorURL and each social sign-in errorCallbackURL to /auth/error. The view reads Better Auth's error query parameter and gives the user a suitable recovery action.

Use /auth/callback?result=email_verified as an email verification callback. The result view also supports account_linked, password_reset, signup_complete, and cancelled. Add flow=email-verification, account-linking, password-reset, or oauth when result=success needs more context. A local redirectTo path adds a Continue action.

Installation

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

After install, src/components/auth/auth.tsx and the copied auth view files are app-owned. Wire it to your TanStack Router auth route or pass an explicit view.

Props

Prop

Type

Last updated on

On this page