Skip to main content

Build your own sign-up page with prebuilt components on web

By default, the <SignIn /> component handles signing in and signing up, but if you'd like to have a dedicated sign-up page, this guide shows you how to use the <SignUp /> component to build a custom sign-up page.

To set up a single sign-in-or-up page, follow the custom sign-in-or-up page guide.

This guide uses Expo Router and platform-specific extensions to build a sign-up page for the web. Expo Router requires a non-platform route alongside a platform-specific route, so create both files shown below.

Build a sign-up page

Create both files in the following structure:

src/
└── app/
    ├── sign-up.tsx
    └── sign-up.web.tsx

The non-platform file renders the native <AuthView />Expo Icon in sign-up mode. Because <AuthView /> doesn't navigate on its own, the example watches the session and redirects once authentication completes. The .web.tsx file renders the web <SignUp /> component.

src/app/sign-up.tsx
import { AuthView } from '@clerk/expo/native'
import { useSession } from '@clerk/expo'
import { useRouter } from 'expo-router'
import { useEffect } from 'react'

export default function Page() {
  const { session } = useSession()
  const router = useRouter()

  useEffect(() => {
    if (session?.status === 'active') {
      router.replace('/')
    }
  }, [session?.status, router])

  return <AuthView mode="signUp" isDismissible={false} />
}
src/app/sign-up.web.tsx
import { SignUp } from '@clerk/expo/web'

export default function Page() {
  return <SignUp />
}

Visit your new page

To run your project, use the following command:

npm run web
pnpm run web
yarn web
bun run web

Visit your new custom pages locally at localhost:8081/sign-up.

Next steps

Learn more about Clerk components, how to build custom flows, and how to use Clerk's client-side helpers using the following guides.

Create a custom sign-up page

Learn how to add a custom sign-up page to your app with Clerk's components.

Prebuilt components

Learn how to quickly add authentication to your app using Clerk's suite of components.

Customization & localization

Learn how to customize and localize Clerk components.

Build custom flows

Learn how to build custom user interfaces entirely from scratch using the Clerk API.

Client-side helpers

Learn more about Clerk's client-side helpers and how to use them.

Feedback

What did you think of this content?

Last updated on