BETTER-AUTH-UI.
GitHub ↗

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 aria

Then 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/auth

This 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-button

Install everything (optional)

To install all components, plugins, and email templates, run this command:

npx shadcn@latest add @better-auth-ui/all

Next steps

Follow a framework-specific guide to integrate Better Auth UI into your project.

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

On this page