āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/clerk/clerk-docs/reference/components/user/user-profile ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
<UserProfile /> component'
description: Clerk's <UserProfile /> component is used to render a beautiful, full-featured account management UI that allows users to manage their profile and security settings.
sdk: astro, chrome-extension, expo, nextjs, nuxt, react, react-router, remix, tanstack-react-start, vue, js-frontend
{{ style: { maxWidth: '100%' } }}
The <UserProfile /> component is used to render a beautiful, full-featured account management UI that allows users to manage their profile, security, and billing settings.
<If sdk={["astro", "chrome-extension", "expo", "nextjs", "nuxt", "react", "react-router", "remix", "tanstack-react-start", "vue"]}
```jsx {{ filename: 'app/user-profile/[[...user-profile]]/page.tsx' }}
import { UserProfile } from '@clerk/nextjs'
const UserProfilePage = () => <UserProfile />
export default UserProfilePage
```
</If>
<If sdk="react">
```jsx {{ filename: 'src/App.tsx' }}
import { UserProfile } from '@clerk/clerk-react'
function App() {
return <UserProfile />
}
export default App
```
</If>
<If sdk="astro">
```astro {{ filename: 'pages/user.astro' }}
---
import { UserProfile } from '@clerk/astro/components'
---
<UserProfile />
```
</If>
<If sdk="expo">
<Include src="_partials/expo/web-only-callout" />
```jsx {{ filename: '/app/user-profile.web.tsx' }}
import { UserProfile } from '@clerk/clerk-expo/web'
export default function UserProfilePage() {
return <UserProfile />
}
```
</If>
<If sdk="chrome-extension">
```jsx {{ filename: 'src/routes/user-profile.tsx' }}
import { UserProfile } from '@clerk/chrome-extension'
export default function UserProfilePage() {
return <UserProfile />
}
```
</If>
<If sdk="remix">
The `<UserProfile />` component must be embedded using the [Remix optional route](https://reactrouter.com/en/main/route/route#optional-segments) in order for the routing to work.
```tsx {{ filename: 'app/routes/user.$.tsx' }}
import { UserProfile } from '@clerk/remix'
export default function UserProfilePage() {
return <UserProfile />
}
```
</If>
<If sdk="react-router">
The `<UserProfile />` component must be embedded using the [React Router Splat route](https://reactrouter.com/start/framework/routing#splats) in order for the routing to work.
```tsx {{ filename: 'app/routes/user-profile.$.tsx' }}
import { UserProfile } from '@clerk/react-router'
export default function UserProfilePage() {
return <UserProfile />
}
```
</If>
<If sdk="tanstack-react-start">
The `<UserProfile />` component must be embedded using the [TanStack Router catch-all route](https://tanstack.com/router/latest/docs/framework/react/routing/routing-concepts#splat--catch-all-routes) in order for the routing to work.
```tsx {{ filename: 'app/routes/user-profile.$.tsx' }}
import { UserProfile } from '@clerk/tanstack-react-start'
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/user-profile/$')({
component: UserProfilePage,
})
function UserProfilePage() {
return <UserProfile />
}
```
</If>
<If sdk="nuxt">
```vue {{ filename: 'pages/user-profile/[...user-profile].vue' }}
<script setup>
// Components are automatically imported
</script>
<template>
<UserProfile />
</template>
```
</If>
<If sdk="vue">
```vue {{ filename: 'user.vue' }}
<script setup>
import { UserProfile } from '@clerk/vue'
</script>
<template>
<UserProfile />
</template>
```
</If>
</If>
<If sdk="js-frontend">
## Usage with JavaScript
The following methods available on an instance of the Clerk class are used to render and control the <UserProfile /> component:
The following examples assume that you have followed the quickstart in order to add Clerk to your JavaScript application.
mountUserProfile()Render the <UserProfile /> component to an HTML <div> element.
function mountUserProfile(node: HTMLDivElement, props?: UserProfileProps): void
mountUserProfile() paramsThe `<div>` element used to render in the `<UserProfile />` component
---
- `props?`
- [`UserProfileProps`](#properties)
The properties to pass to the `<UserProfile />` component
</Properties>
mountUserProfile() usageimport { Clerk } from '@clerk/clerk-js'
// Initialize Clerk with your Clerk Publishable Key
const clerkPubKey = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY
const clerk = new Clerk(clerkPubKey)
await clerk.load()
document.getElementById('app').innerHTML = `
<div id="user-profile"></div>
`
const userProfileDiv = document.getElementById('user-profile')
clerk.mountUserProfile(userProfileDiv)
unmountUserProfile()Unmount and run cleanup on an existing <UserProfile /> component instance.
function unmountUserProfile(node: HTMLDivElement): void
unmountUserProfile() paramsThe container `<div>` element with a rendered `<UserProfile />` component instance.
</Properties>
unmountUserProfile() usageimport { Clerk } from '@clerk/clerk-js'
// Initialize Clerk with your Clerk Publishable Key
const clerkPubKey = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY
const clerk = new Clerk(clerkPubKey)
await clerk.load()
document.getElementById('app').innerHTML = `
<div id="user-profile"></div>
`
const userProfileDiv = document.getElementById('user-profile')
clerk.mountUserProfile(userProfileDiv)
// ...
clerk.unmountUserProfile(userProfileDiv)
openUserProfile()Opens the <UserProfile /> component as an overlay at the root of your HTML body element.
function openUserProfile(props?: UserProfileProps): void
openUserProfile() paramsThe properties to pass to the `<UserProfile />` component
</Properties>
openUserProfile() usageimport { Clerk } from '@clerk/clerk-js'
// Initialize Clerk with your Clerk Publishable Key
const clerkPubKey = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY
const clerk = new Clerk(clerkPubKey)
await clerk.load()
document.getElementById('app').innerHTML = `
<div id="user-profile"></div>
`
const userProfileDiv = document.getElementById('user-profile')
clerk.openUserProfile(userProfileDiv)
closeUserProfile()Closes the user profile overlay.
function closeUserProfile(): void
closeUserProfile() usageimport { Clerk } from '@clerk/clerk-js'
// Initialize Clerk with your Clerk Publishable Key
const clerkPubKey = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY
const clerk = new Clerk(clerkPubKey)
await clerk.load()
document.getElementById('app').innerHTML = `
<div id="user-profile"></div>
`
const userProfileDiv = document.getElementById('user-profile')
clerk.closeUserProfile(userProfileDiv)
</If>
All props are optional.
<Properties> - `appearance` - <code>[Appearance](/docs/guides/customizing-clerk/appearance-prop/overview) | undefined</code>Optional object to style your components. Will only affect Clerk components and not Account Portal pages.
routing'hash' | 'path'The routing strategy for your pages. Defaults to 'path' for frameworks that handle routing, such as Next.js and Remix. Defaults to hash for all other SDK's, such as React.
pathstringThe path where the component is mounted on when routing is set to path. It is ignored in hash-based routing. For example: /user-profile.
additionalOAuthScopesobjectSpecify additional scopes per OAuth provider that your users would like to provide if not already approved. For example: {google: ['foo', 'bar'], github: ['qux']}.
customPagesAn array of custom pages to add to the user profile. Only available for the JavaScript SDK. To add custom pages with React-based SDK's, see the dedicated guide.
fallback?ReactNodeAn optional element to be rendered while the component is mounting. </Properties>
To learn about how to customize Clerk components, see the customization documentation.
In addition, you also can add custom pages and links to the <UserProfile /> navigation sidenav. For more information, refer to the Custom Pages documentation.
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā