Quick Start
Get started with Better Auth UI for shadcn/ui.
Prerequisites
Install these prerequisites in your project:
Component bases
Better Auth UI supports the Radix, Base UI, and React Aria bases in shadcn/ui.
The registry uses the style in your components.json to install the matching components.
Every base includes the same authentication flows, settings, and plugins.
For a new React Aria project, initialize shadcn with the Aria base:
bunx --bun shadcn@latest init --base ariaThen follow the installation steps below. Read the shadcn React Aria documentation for primitive APIs and composition.
Installation
Install the auth components
Install the authentication page components with the shadcn CLI.
npx shadcn@latest add @better-auth-ui/authThis command installs <Auth /> and its built-in authentication views.
Install settings and user button (optional)
If you need the settings page and user button, install them separately.
npx shadcn@latest add @better-auth-ui/settings @better-auth-ui/user-buttonInstall everything (optional)
To install all components, plugins, and email templates, run this command:
npx shadcn@latest add @better-auth-ui/allNext steps
Follow a framework-specific guide to integrate Better Auth UI into your project.
TanStack Start
Integrate Better Auth UI with TanStack Start
Next.js
Integrate Better Auth UI with Next.js
React Reference
Each shadcn/ui component uses the shared @better-auth-ui/react data layer. Read the React reference to access or change authentication state directly.
Last updated on