User Button

A dropdown menu component that displays the current user's avatar, name, email, and plan. Provides quick access to settings, billing, and sign out actions.

Usage

component.tsx
import { UserButton } from "@/components/ui/user-button"

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

Behavior

StateDisplay
User is on a paid planShows Billing item to manage subscription via Stripe portal.
User is on the free planShows Upgrade Plan item that redirects to the pricing page.
User has a nameDisplays the name in the dropdown label.
User has no nameFalls back to displaying the email address.
ItemDescription
SettingsNavigates to the settings page.
BillingOpens the Stripe customer portal. Only visible for paid plan users.
Upgrade PlanRedirects to the pricing page. Only visible for free plan users.
LogoutSigns out the current user and redirects to /sign-in.

The user-button.tsx file already comes in the EasyToLaunch repo by default.

On this page