Skip to main content
Docs

<UserButton />

Note

This documents the native <UserButton /> from @clerk/expo/native. For web projects, use the web <UserButton /> component.

The <UserButton /> component renders an avatar that displays the user's profile image or initials. When tapped, it opens a native profile management modal powered by <UserProfileView />Expo Icon.

Sign-out is handled automatically and synced with the JavaScript SDK. If you need to react to sign-out, use useAuth() inside a useEffect.

The component fills its parent container - use the parent's styles to control size, shape, border radius, and clipping.

Requirements

Important

Before using this component, ensure you meet the Expo requirementsExpo Icon.

In addition to these requirements, this component requires the user to be signed in (use with <SignedIn> or check useUser())

app/(home)/index.tsx
import { SignedIn, SignedOut } from '@clerk/expo'
import { UserButton } from '@clerk/expo/native'
import { AuthView } from '@clerk/expo/native'

export default function Screen() {
  return (
    <>
      <SignedIn>
        <View style={{ width: 36, height: 36, borderRadius: 18, overflow: 'hidden' }}>
          <UserButton />
        </View>
      </SignedIn>
      <SignedOut>
        <AuthView />
      </SignedOut>
    </>
  )
}

Usage

The following examples show how to use the <UserButton /> in your Expo app.

Basic usage

app/(home)/index.tsx
import { View, Text } from 'react-native'
import { UserButton } from '@clerk/expo/native'
import { useUser } from '@clerk/expo'

export default function HomeScreen() {
  const { user } = useUser()

  return (
    <View style={{ flex: 1, padding: 20 }}>
      <View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
        <Text style={{ fontSize: 24 }}>Welcome, {user?.firstName}</Text>
        <View style={{ width: 36, height: 36, borderRadius: 18, overflow: 'hidden' }}>
          <UserButton />
        </View>
      </View>
    </View>
  )
}
app/(home)/_layout.tsx
import { View } from 'react-native'
import { Stack } from 'expo-router'
import { UserButton } from '@clerk/expo/native'

export default function HomeLayout() {
  return (
    <Stack
      screenOptions={{
        headerRight: () => (
          <View
            style={{ width: 36, height: 36, borderRadius: 18, overflow: 'hidden', marginRight: 16 }}
          >
            <UserButton />
          </View>
        ),
      }}
    >
      <Stack.Screen name="index" options={{ title: 'Home' }} />
    </Stack>
  )
}

Properties

The <UserButton /> component does not accept any props. It fills its parent container — use the parent's style to control size, shape, border radius, and clipping.

Platform support

PlatformStatus
iOSSupported (SwiftUI)
AndroidSupported (Jetpack Compose)
WebUse <UserButton /> from @clerk/expo/web

Feedback

What did you think of this content?

Last updated on