Skip to content

Looking for Clerk’s docs? Head to clerk.com/docs (opens in a new tab)

Mosaic
On this page

Profile

A surface you navigate: a column of pages beside the page each one opens, as tabs. When narrow, the nav becomes a select on the page title, then a sheet on a phone. Inside a Dialog it adds the close control.

Use for

  • a user or organization profile with several pages
  • a settings surface with side navigation
  • a tabbed page layout that collapses on small screens
  • a page that opens sub-pages with a back button

Practices

GuidancePractice
DoRender a Profile.Title. It names the nav, and stays visually hidden.
DoGive each Profile.NavItem a value that matches a Profile.ContentPanel, and start each page with a Panel.Title, its page title.
DoPass a string as a Profile.NavItem child, so it names the option when the nav is a select.
DoFor a page with sub-pages, give its Profile.ContentPanel a label, subPage and onSubPageChange, and wrap every view in a Profile.SubPage, the page itself as value={null}.
DoOpen a sub-page from a panel through a callback prop, such as onManagePasskeys, so the panel also works on its own.
Don’tWrap a sub-page in your own Flow. Profile.ContentPanel moves between its sub-pages and focuses the new title.

API reference

Profile.Root

Holds the selected page and the nav layout. Renders a div, or the render element.

Slot: cl-profile

PropTypeDescription
valuestringThe selected page.
onValueChange(value: string) => voidCalled with the page the user picks.
orientationTabsProps['orientation']Tab arrow-key direction.Default: 'vertical'
activationModeTabsProps['activationMode']Whether focusing a tab selects it. The sheet nav always uses manual.
renderBrandingbooleanShows Clerk branding in the wide layout.Default: true
elevationProfileElevationcard draws a card. flush sits inline in the page; inside a Dialog it stays card.Default: 'card'

Profile.Title

A visually hidden heading at the current level that names the profile and its nav.

Slot: cl-profile-title

Profile.Nav

A nav of Profile.NavItems or Profile.NavGroups. Renders as a tablist, the options of the page title select, or a tablist in a sheet.

Slot: cl-profile-nav

Profile.NavGroup

A labelled run of nav items. As tabs the label describes each item; as options it names the group.

Slot: cl-profile-nav-group

PropTypeDescription
labelReact.ReactNodeThe group name, shown above its items.

Profile.NavItem

One page in the nav, as a tab or an option.

Slot: cl-profile-nav-item

PropTypeDescription
valuestringThe page it opens.
iconReact.ReactNodeA leading icon, hidden from assistive tech.
badgeReact.ReactNodeA trailing Badge. Badges in it default to neutral.
disabledbooleanDisables the item.

Profile.Content

The scrolling page area. Each page's Panel.Title is its page title, and the navigation's trigger on compact layouts.

Slot: cl-profile-content

Profile.ContentPanel

One page, shown while its value is selected. Sets the heading level one below the page title.

Slot: cl-profile-content-panel

PropTypeDescription
valuestringThe page it shows for. Matches a Profile.NavItem value.
labelstringThe page's name, shown on the back button of each of its sub-pages. Required with subPage.
subPagestring | nullThe open sub-page, or null for the page itself. Matches a Profile.SubPage value. Leave it out for a page without sub-pages.
onSubPageChange(subPage: string | null) => voidCalled with null when the user goes back to the page. Required with subPage.

Profile.SubPage

One view of a Profile.ContentPanel with sub-pages, shown while its value is the open subPage, in a Flow.Step. A sub-page's Panel.Title gets a small back button above it, read as "Back to {label}", and never opens the navigation on compact layouts.

PropTypeDescription
valuestring | nullThe sub-page it shows for, or null for the page itself.

Examples

A two-page profile

TSX
<Profile.Root value={page} onValueChange={setPage}>
  <Profile.Title>User profile</Profile.Title>
  <Profile.Nav>
    <Profile.NavItem value='account'>Account</Profile.NavItem>
    <Profile.NavItem value='security'>Security</Profile.NavItem>
  </Profile.Nav>
  <Profile.Content>
    <Profile.ContentPanel value='account'>
      <Panel.Root>
        <Panel.Title>Account</Panel.Title>
        …
      </Panel.Root>
    </Profile.ContentPanel>
    <Profile.ContentPanel value='security'>…</Profile.ContentPanel>
  </Profile.Content>
</Profile.Root>

A page with a sub-page

TSX
<Profile.ContentPanel value='security' label='Security' subPage={subPage} onSubPageChange={setSubPage}>
  <Profile.SubPage value={null}>
    <SecurityPanel onManagePasskeys={() => setSubPage('passkeys')} />
  </Profile.SubPage>
  <Profile.SubPage value='passkeys'>
    <PasskeysPanel />
  </Profile.SubPage>
</Profile.ContentPanel>