Trigger app actions
A user menu needs to open an application modal, such as chat or help.
Clerk · Component
UserButton.MenuItems is the Clerk container for adding custom actions and navigation links to a UserButton menu. It also supports arranging default entries and conditionally displaying menu items.
UserButton.MenuItems is the container for extending Clerk's user menu. Place UserButton.Action children inside it for click-driven behavior and UserButton.Link children for navigation; the same area can also contain reordered built-in items and conditionally rendered entries.
<UserButton><UserButton.MenuItems>...</UserButton.MenuItems></UserButton>| Name | Type | Description |
|---|---|---|
children | React nodes | Container for custom UserButton.Action and UserButton.Link children; the page does not specify standalone parameters for MenuItems. |
A customized UserButton menu containing the supplied custom entries.
import { UserButton } from '@clerk/nextjs';
export function AccountMenu() {
return (
<UserButton>
<UserButton.MenuItems>
<UserButton.Link label="Terms" href="/terms" />
<UserButton.Action
label="Open chat"
clickIdentifier="open_chat"
onClick={() => alert('Chat opened')}
/>
</UserButton.MenuItems>
</UserButton>
);
}This adds an internal navigation link and a custom action to the user menu.
A user menu needs to open an application modal, such as chat or help.
Users need quick access to an internal settings route or an external resource.
Account controls must appear in a deliberate order alongside custom entries.
Administrative menu entries should appear only for authorized users.
Use UserButton.Action for behavior such as opening a chat or modal, and UserButton.Link when selecting the item should navigate to a page. Both are placed inside UserButton.MenuItems.
Follow-up: How would you make an entry available only to authorized users? Render the menu item conditionally using Clerk's has() helper with the user's role or custom permission.
The component provides Manage account and Sign out by default. Their positions can be changed by adding entries with labels manageAccount and signOut.
Follow-up: What additional menu behavior does the page describe? Custom entries can be conditionally rendered based on a user's role or custom permissions.
UserButton.MenuItems is the extension point inside UserButton for custom menu entries. It accepts action items for click handlers and link items for internal or external navigation.
Follow-up: How would you represent an app-specific settings destination? Use UserButton.Link with a label and an appropriate relative internal path or external URL.
UserButtonUserButton.ActionUserButton.Linkhas()