Skip to main content
@glinr/theauth-ui provides drop-in React components for auth flows. Each component renders inside TheAuthProvider from @glinr/theauth-react and wires up to your theAuth API route automatically, no manual fetch calls required.
Components require @glinr/theauth-react to be installed and a TheAuthProvider wrapping your app. See the React hooks page for provider setup.

Installation

Components are unstyled by default and rely on Tailwind CSS for layout and spacing. Add @glinr/theauth-ui to your tailwind.config.ts content paths:

Copy the source into your project

If you want to own and edit the components rather than depend on the package, copy them in, the way shadcn/ui works. This is optional: the packaged components keep working and you can mix both.
The command writes plain TSX into src/components/theauth (or components/theauth when there is no src folder), prints the one dependency to install, and never overwrites a file you changed unless you pass --overwrite. Each component pulls in theauth-base (types, class helper, default slots and the auth card) once.
The same items are published in the shadcn registry format, so the shadcn CLI works too:
Then import from the copied folder and keep wiring through TheAuthProvider as above:
Copied files import @glinr/theauth-react for the hooks and nothing else beyond React. Re-run theauth add <name> --overwrite after upgrading if you want the newer upstream version, and review the diff first.

Available components

SignIn

Renders an email/password form. Pass showMagicLink to add a passwordless tab. Pass providers to show OAuth buttons above the form.
OAuthProviderMeta[]
default:"[]"
OAuth providers to show above the form.
Add a magic-link tab alongside password sign-in.
string
URL for the “Sign up” link in the footer.
string
URL for the “Forgot password?” link.
() => void
Called on successful sign-in.
string
default:"\"Sign in\""
Heading text.
string
default:"\"/api/theauth\""
Must match your theAuth API route.

SignUp

boolean
default:"false"
Include a name field.
boolean
default:"false"
Add a confirm-password field.
string
URL for the “Sign in” link.
() => void
Called on successful registration.

UserButton

Renders an avatar that opens a dropdown menu. Includes sign-out by default. Pass menuItems to add custom actions.

OAuthButtons

Use standalone when you want social login without the full sign-in card.
OAUTH_PROVIDERS ships with metadata and icons for Google, GitHub, GitLab, Discord, Twitter, Facebook, Microsoft, Apple, LinkedIn, Slack, Notion, Reddit, Spotify, and Twitch. You can also pass a custom provider object matching OAuthProviderMeta.

Customization

Class name overrides

Every component accepts a classNames prop with keys for each sub-element. Pass a string to append classes, or a function that receives the default class string.

Slot replacement

Pass a components prop to replace any primitive (input, button, link, divider, error). Useful when you need to use your own design system components.
The cx utility is exported from @glinr/theauth-ui for merging class names in your own slot components.

Framework examples

Next.js App Router

Vite + React Router

Next steps

React hooks

useSession, useUser, useSignIn, and more.

Adapters

Mount the theAuth handler in Next.js, Express, Hono, and others.

Auth

Configure email/password, magic links, OAuth, and 2FA.
Last modified on October 13, 2026