Skip to Content
Clerk logo

Clerk Docs

Ctrl + K
Go to clerkstage.dev

<SignUpButton>

The <SignUpButton> component is a button that links to the sign-up page or displays the sign-up modal.

<SignUpButton> properties

NameTypeDescription
signUpFallbackRedirectUrl?stringThe 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.
signUpForceRedirectUrl?stringIf provided, this URL will always be redirected to after the user signs up. It's recommended to use the environment variable instead.
mode?'redirect' | 'modal'Determines what happens when a user clicks on the <SignUpButton>. Setting this to 'redirect' will redirect the user to the sign-up route. Setting this to 'modal' will open a modal on the current route.
Defaults to 'redirect'
children?React.ReactNodeChildren you want to wrap the <SignUpButton> in.

How to use the <SignUp> button

Basic usage

pages/index.js
import { SignUpButton } from "@clerk/nextjs"; export default function Home() { return ( <div> <SignUpButton /> </div> ); }
example.js
import { SignUpButton } from "@clerk/clerk-react"; export default function Example() { return ( <div> <SignUpButton /> </div> ); }
pages/index.js
import { SignUpButton } from "@clerk/remix"; export default function Home() { return ( <div> <SignUpButton /> </div> ); }
pages/index.js
import { SignUpButton } from "gatsby-plugin-clerk"; export default function Home() { return ( <div> <SignUpButton /> </div> ); }

Custom usage

In some cases, you will want to use your own button, or button text. You can do that by wrapping your button in the <SignUpButton> component.

pages/index.js
import { SignUpButton } from "@clerk/nextjs"; export default function Home() { return ( <div> <SignUpButton mode="modal"> <button> Sign up </button> </SignUpButton> </div> ); }
example.js
import { SignUpButton } from "@clerk/clerk-react"; export default function Example() { return ( <div> <SignUpButton mode="modal"> <button> Sign up </button> </SignUpButton> </div> ); }
pages/index.js
import { SignUpButton } from "@clerk/remix"; export default function Home() { return ( <div> <SignUpButton mode="modal"> <button> Sign up </button> </SignUpButton> </div> ); }
pages/index.js
import { SignUpButton } from "gatsby-plugin-clerk"; export default function Home() { return ( <div> <SignUpButton mode="modal"> <button> Sign up </button> </SignUpButton> </div> ); }

What did you think of this content?

Clerk © 2024