> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Universal Components for Web Applications

> Learn how to install and configure Auth0 Universal Components for web applications.

> [!WARNING]
>
> **The Auth0 Universal Components feature is in [Early Access](/docs/docs/troubleshoot/product-lifecycle/product-release-stages).**
>
> To participate, contact Auth0 Support.
>
> By using this feature, you agree to the applicable Free Trial terms in Okta's [Master Subscription Agreement](https://www.okta.com/legal).

The Auth0 [Universal Components for Web](https://github.com/auth0/auth0-ui-components) library provides pre-built, embeddable UI for Auth0 identity flows using [React](https://react.dev/) and [Next.js](https://nextjs.org/).

Universal Components for Web are built on top of the [Auth0 SDKs](/docs/docs/libraries) and integrate with the [My Organization API](/docs/docs/api/myorganization) to power embedded delegated administration, such as managing Organizations, domains, and SSO providers.

## Prerequisites

To use Auth0 Universal Components for Web:

* You must [have an Auth0 account](https://auth0.com) and configure an Auth0 tenant with the My Organization API enabled.
* [Register your Auth0 application](/docs/docs/get-started/auth0-overview/create-applications). If you do not have an Auth0 application, you can get started with the Auth0 React or Next.js [Quickstarts](/docs/docs/quickstart/spa/react).
* For client-side authentication, install **React v.16.11+**.
* For server-side authentication, install **Next.js v.13+**.

> [tab] React
>
> ## Install Universal Components
>
> ```bash npm  wrap lines theme={null}
> npm install @auth0/universal-components-react react-hook-form @auth0/auth0-react
> ```
>
> ```bash pnpm wrap lines theme={null}
> pnpm add @auth0/universal-components-react react-hook-form @auth0/auth0-react
> ```
>
> Installs the package alongside `react-hook-form` (a peer dependency) and `@auth0/auth0-react` (required for client-side SPA authentication). The Next.js tab uses proxy mode and does not need `@auth0/auth0-react`.
>
> ## Configure your application
>
> 1. Wrap your application with `Auth0Provider` and `Auth0ComponentProvider`:
>
> ```tsx App.tsx wrap lines theme={null}
> import { Auth0Provider } from "@auth0/auth0-react";
> import { Auth0ComponentProvider } from "@auth0/universal-components-react/spa";
> import "@auth0/universal-components-react/styles";
>
> const domain = import.meta.env.VITE_AUTH0_DOMAIN;
>
> function App() {
>   return (
>     <Auth0Provider
>       domain={domain}
>       clientId={import.meta.env.VITE_AUTH0_CLIENT_ID}
>       authorizationParams={{
>         redirect_uri: window.location.origin,
>       }}
>       interactiveErrorHandler='popup' // Required to handle step-up auth challenges via Universal Login popup
>     >
>       <Auth0ComponentProvider>
>         {/* Your app components */}
>       </Auth0ComponentProvider>
>     </Auth0Provider>
>   );
> }
> ```
>
> 2. Import Universal Components:
>
> ```tsx OrganizationManagementPage.tsx wrap lines theme={null}
> import { useAuth0 } from "@auth0/auth0-react";
> import { OrganizationDetailsEdit } from "@auth0/universal-components-react/spa";
>
> function OrganizationManagementPage() {
>   const { isAuthenticated, isLoading } = useAuth0();
>
>   if (isLoading) return <div>Loading...</div>;
>   if (!isAuthenticated) return <div>Please log in</div>;
>
>   return (
>     <div>
>       <OrganizationDetailsEdit />
>     </div>
>   );
> }
> ```
>
> ## Configure Universal Components
>
> The `Auth0ComponentProvider` manages authentication, caching, internationalization, and toast notifications for all components.
>
> ```tsx App.tsx wrap lines theme={null}
> <Auth0ComponentProvider
>   domain="your-tenant.auth0.com"
>   i18n={{ currentLanguage: "en" }}
>   themeSettings={{ mode: "light", theme: "default" }}
> >
>   {/* Your app components */}
> </Auth0ComponentProvider>
> ```
>
> ## Style components
>
> The stylesheet you imported (`@auth0/universal-components-react/styles`)
> enables all component styles. If you're using Tailwind v4, add `@import
>         "@auth0/universal-components-react/tailwind"` to your CSS file.
>
> Use CSS variables to customize your branding:
>
> ```css wrap lines theme={null}
> :root {
>   --primary: #4f46e5; /* your brand color */
>   --primary-foreground: #ffffff; /* text on buttons */
> }
> ```
>
> To learn more, read [Style Universal Components](/docs/docs/get-started/universal-components/web/universal-components-style).

> [tab] Next.js
>
> ## Install Universal Components
>
> You do not need `@auth0/auth0-react`. The Next.js implementation uses proxy
> mode with server-side authentication.
>
> ```bash npm  wrap lines theme={null}
> npm install @auth0/universal-components-react react-hook-form
> ```
>
> ```bash pnpm wrap lines theme={null}
> pnpm add @auth0/universal-components-react react-hook-form
> ```
>
> ## Configure your application
>
> 1. Wrap your application with `Auth0Provider` and `Auth0ComponentProvider`:
>
>    In your root layout, add the `Auth0ComponentProvider` in proxy mode. `Auth0Provider` is configured separately in your Next.js setup (typically in `layout.tsx` via [`@auth0/nextjs-auth0`](https://github.com/auth0/nextjs-auth0)).
>
> ```tsx layout.tsx wrap lines theme={null}
> import { Auth0ComponentProvider } from "@auth0/universal-components-react/rwa";
> import "@auth0/universal-components-react/styles";
>
> export default function RootLayout({ children }) {
>   return (
>     <html lang="en">
>       <body>
>         <Auth0ComponentProvider
>           mode="proxy"
>           domain={process.env.NEXT_PUBLIC_AUTH0_DOMAIN}
>           proxyConfig={{ baseUrl: "/api/auth" }}
>         >
>           {children}
>         </Auth0ComponentProvider>
>       </body>
>     </html>
>   );
> }
> ```
>
> 2. Import Universal Components:
>
> ```tsx page.tsx wrap lines theme={null}
> import { OrganizationDetailsEdit } from "@auth0/universal-components-react/rwa";
>
> export default function OrganizationManagementPage() {
>   return (
>     <div>
>       <OrganizationDetailsEdit />
>     </div>
>   );
> }
> ```
>
> ## Configure Universal Components
>
> The `Auth0ComponentProvider` manages authentication, caching, internationalization, and toast notifications for all components. In Next.js, use proxy mode for server-side authentication.
>
> ```tsx layout.tsx wrap lines theme={null}
> <Auth0ComponentProvider
>   mode="proxy"
>   domain="your-tenant.auth0.com"
>   proxyConfig={{ baseUrl: "/api/auth" }}
>   i18n={{ currentLanguage: "en" }}
>   themeSettings={{ mode: "light", theme: "default" }}
> >
>   {/* Your app components */}
> </Auth0ComponentProvider>
> ```
>
> ## Style components
>
> The stylesheet you imported (`@auth0/universal-components-react/styles`)
> enables all component styles. If you're using Tailwind v4, add `@import
>         "@auth0/universal-components-react/tailwind"` to your CSS file.
>
> Use CSS variables to customize your branding:
>
> ```css wrap lines theme={null}
> :root {
>   --primary: #4f46e5; /* your brand color */
>   --primary-foreground: #ffffff; /* text on buttons */
> }
> ```
>
> To learn more, read [Style Universal Components](/docs/docs/get-started/universal-components/web/universal-components-style).

> [tab] shadcn
>
> ## Install Universal Components
>
> Universal Components use `@/...` imports. Start by configuring the path alias and project dependencies:
>
> ```bash wrap lines theme={null}
> npx shadcn@latest init
> ```
>
> Next, install Universal Components individually via the shadcn CLI using the GitHub Registry:
>
> ```bash wrap lines theme={null}
> npx shadcn@latest add auth0/auth0-ui-components/react/my-organization/organization-details-edit
> ```
>
> The shadcn CLI installs the component source code and the
> `@auth0/universal-components-core` dependency for shared utilities and Auth0
> integration. Requires **shadcn CLI v2.5.0+** (GitHub Registry support).
>
> **Legacy Vercel registry retired**: The Vercel-hosted registry
> (`https://auth0-universal-components.vercel.app/r/...`) was retired on
> **September 17, 2026**. Use the GitHub Registry path above.
>
> ## Configure your application
>
> 1. Wrap your application with `Auth0Provider` and `Auth0ComponentProvider`:
>
> ```tsx App.tsx wrap lines theme={null}
> import { Auth0Provider } from "@auth0/auth0-react";
> import { Auth0ComponentProvider } from "@auth0/universal-components-react/spa";
>
> const domain = import.meta.env.VITE_AUTH0_DOMAIN;
>
> function App() {
>   return (
>     <Auth0Provider
>       domain={domain}
>       clientId={import.meta.env.VITE_AUTH0_CLIENT_ID}
>       authorizationParams={{
>         redirect_uri: window.location.origin,
>       }}
>       interactiveErrorHandler='popup' // Required to handle step-up auth challenges via Universal Login popup
>     >
>       <Auth0ComponentProvider>
>         {/* Your app components */}
>       </Auth0ComponentProvider>
>     </Auth0Provider>
>   );
> }
> ```
>
> 2. Import Universal Components:
>
> ```tsx OrganizationManagementPage.tsx wrap lines theme={null}
> import { OrganizationDetailsEdit } from "@/components/auth0/my-organization/organization-details-edit";
>
> function OrganizationManagementPage() {
>   return (
>     <div>
>       <OrganizationDetailsEdit />
>     </div>
>   );
> }
> ```
>
> ## Configure Universal Components
>
> The `Auth0ComponentProvider` manages authentication, caching, internationalization, and toast notifications for all components.
>
> ```tsx App.tsx wrap lines theme={null}
> <Auth0ComponentProvider
>   domain="your-tenant.auth0.com"
>   i18n={{ currentLanguage: "en" }}
>   themeSettings={{ mode: "light", theme: "default" }}
> >
>   {/* Your app components */}
> </Auth0ComponentProvider>
> ```
>
> ## Style components
>
> Styles for Shadcn are already included in your Tailwind build. No additional
> style imports are needed.
>
> Use CSS variables to customize your branding:
>
> ```css wrap lines theme={null}
> :root {
>   --primary: #4f46e5; /* your brand color */
>   --primary-foreground: #ffffff; /* text on buttons */
> }
> ```
>
> To learn more, read [Style Universal Components](/docs/docs/get-started/universal-components/web/universal-components-style).

## Example implementations

See complete working examples in the sample applications.

> [card] [Code Examples](https://github.com/auth0/auth0-ui-components/tree/main/examples)
>
> React SPA (npm), React SPA (shadcn), and Next.js sample applications with full
> implementation patterns

> [card] [SaaStart Live Demo](https://universal-components-saastart.vercel.app/)
>
> See My Organization Components in action in the live reference B2B SaaS app

> [card] [SaaS Starter Repository](https://github.com/auth0/saas-start-universal-components)
>
> A secure and high-performance starting point for building modern B2B SaaS web applications.

## Next steps

> [card] [Configure Auth0ComponentProvider](/docs/docs/get-started/universal-components/web/auth0-component-provider)
>
> Synchronize authentication, internationalization, theming, toast notifications, and caching across all components.

> [card] [Customize style and themes](/docs/docs/get-started/universal-components/web/universal-components-style)
>
> Customize the design system using Tailwind CSS, CSS variables, and built-in theme presets.

> [card] [Build a Delegated Admin Interface](/docs/docs/get-started/universal-components/web/components/build-delegated-admin)
>
> Use the My Organization API to let your customers manage their own Organizations, domains, and SSO providers.

> [card] [Build a Self-Service Account Security Interface](/docs/docs/get-started/universal-components/web/components/my-account-overview)
>
> Use the My Account API to let your users manage their own MFA factors and passkeys.
