Skip to Content
Clerk logo

Clerk Docs

Ctrl + K
Go to clerkstage.dev

<SignOutButton />

The <SignOutButton /> component is a button that signs a user out. By default, it is a <button> tag that says Sign Out, but it is completely customizable by passing children.

Usage

Basic Usage

app/page.js
import { SignOutButton } from "@clerk/nextjs"; export default function Home() { return ( <div> <h1> Sign out </h1> <SignOutButton /> </div> ); }
pages/index.js
import { SignOutButton } from "@clerk/nextjs"; export default function Home() { return ( <div> <h1> Sign out </h1> <SignOutButton /> </div> ); }

Custom Usage

You can create a custom button by wrapping your own button, or button text, in the <SignOutButton /> component.

app/page.js
import { SignOutButton } from "@clerk/nextjs"; export default function Home() { return ( <div> <h1> Sign out </h1> <SignOutButton> <button>Sign in with Clerk</button> </SignOutButton> </div> ); }
pages/index.js
import { SignOutButton } from "@clerk/nextjs"; export default function Home() { return ( <div> <h1> Sign out </h1> <SignOutButton> <button>Sign in with Clerk</button> </SignOutButton> </div> ); }

Properties

NameTypeDescription
signOutCallback?() => (void | Promise<any>)A promise to handle after the sign out has successfully happened.
children?React.ReactNodechildren you want to wrap the <SignOutButton /> in.
signOutOptions?SignOutOptionsObject that has a sessionId property. The sessionId can be passed in to sign out a specific session, which is useful for multisession applications.

What did you think of this content?

Clerk © 2023