<SignUp />
component

The <SignUp />
component renders a UI for signing up users. The functionality of the <SignUp />
component is controlled by the instance settings you specify in the Clerk Dashboard, such as sign-in and sign-up options and social connections. You can further customize your <SignUp />
component by passing additional properties at the time of rendering.
Properties
All props are optional.
- Name
appearance
- Type
Appearance | undefined
- Description
Optional object to style your components. Will only affect Clerk components and not Account Portal pages.
- Name
fallback
- Type
ReactNode
- Description
An optional element to be rendered while the component is mounting.
- Name
fallbackRedirectUrl
- Type
string
- Description
The fallback URL to redirect to after the user signs up, if there's no
redirect_url
in the path already. Defaults to/
. It's recommended to use the environment variable instead.
- Name
forceRedirectUrl
- Type
string
- Description
If provided, this URL will always be used as the redirect destination after the user signs up. It's recommended to use the environment variable instead.
- Name
initialValues
- Type
SignUpInitialValues
- Description
The values used to prefill the sign-up fields with.
- Name
oauthFlow
- Type
"redirect" | "popup" | "auto"
- Description
Determines how OAuth authentication is performed. Accepts the following properties:
"redirect"
: Redirect to the OAuth provider on the current page."popup"
: Open a popup window."auto"
: Choose the best method based on whether the current domain typically requires the"popup"
flow to correctly perform authentication.
Defaults to
"auto"
.
- Name
path
- Type
string
- Description
The path where the component is mounted on when
routing
is set topath
. It is ignored in hash-based routing. For example:/sign-up
.
- Name
routing
- Type
'hash' | 'path'
- Description
The routing strategy for your pages. Defaults to
'path'
for frameworks that handle routing, such as Next.js and Remix. Defaults tohash
for all other SDK's, such as React.
- Name
signInFallbackRedirectUrl
- Type
string
- Description
The fallback URL to redirect to after the user signs in, if there's no
redirect_url
in the path already. Used for the 'Already have an account? Sign in' link that's rendered. Defaults to/
. It's recommended to use the environment variable instead.
- Name
signInForceRedirectUrl?
- Type
string
- Description
If provided, this URL will always be redirected to after the user signs in. Used for the 'Already have an account? Sign in' link that's rendered. It's recommended to use the environment variable instead.
- Name
signInUrl
- Type
string
- Description
The full URL or path to the sign-in page. Used for the 'Already have an account? Sign in' link that's rendered. It's recommended to use the environment variable instead.
- Name
unsafeMetadata
- Type
SignUpUnsafeMetadata
- Description
Metadata that can be read and set from the frontend and the backend. Once the sign-up is complete, the value of this field will be automatically copied to the created user's unsafe metadata (
User.unsafeMetadata
). One common use case is to collect custom information about the user during the sign-up process and store it in this property. Read more about unsafe metadata.
Usage with frameworks
The following example includes basic implementation of the <SignUp />
component. You can use this as a starting point for your own implementation.
The following example demonstrates how you can use the <SignUp />
component on a public page.
If you would like to create a dedicated /sign-up
page in your Next.js application, there are a few requirements you must follow. See the dedicated guide for more information.
'use client'
import { SignUp, useUser } from '@clerk/nextjs'
export default function Home() {
const { user } = useUser()
if (!user) return <SignUp />
return <div>Welcome!</div>
}
Customization
To learn about how to customize Clerk components, see the customization documentation.
If Clerk's prebuilt components don't meet your specific needs or if you require more control over the logic, you can rebuild the existing Clerk flows using the Clerk API. For more information, see the custom flow guides.
Feedback
Last updated on