Better Auth UI: Plug & Play Shadcn/UI Components

3.2.27 · active · verified Wed Apr 22

better-auth-ui is a comprehensive React component library providing plug-and-play authentication UIs built on `shadcn/ui` for the `better-auth` ecosystem. Currently at version 3.2.27, it delivers a suite of pre-built, highly customizable components covering common authentication flows such as sign-in, sign-up, password recovery, user profile management, and settings. The library aims to streamline the development of secure and aesthetically pleasing authentication interfaces by leveraging `shadcn/ui` for styling, `react-hook-form` for form management, and `@tanstack/react-query` for data fetching. It ships with full TypeScript support, ensuring type safety and a robust developer experience. While a specific release cadence isn't detailed, the consistent versioning indicates active development, focusing on integration with `better-auth` to empower developers to 'Own Your Auth' with minimal setup.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates wrapping an application with AuthUIProvider and rendering the SignInCard component, typically in a dedicated login page.

import { AuthUIProvider, SignInCard } from "better-auth-ui";
import React from 'react';

// In your main layout file, e.g., src/app/layout.tsx (for Next.js App Router)
export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        <AuthUIProvider>
          {children}
        </AuthUIProvider>
      </body>
    </html>
  );
}

// In a page component, e.g., src/app/login/page.tsx
export function LoginPage() {
  return (
    <div className="flex min-h-screen items-center justify-center p-4">
      <SignInCard />
    </div>
  );
}

view raw JSON →