UserButton
The UserButton is a circular button that displays the signed-in user's profile image. When tapped, it presents a sheet with the UserProfileView.
struct HomeView: View {
@Environment(\.clerk) private var clerk
var body: some View {
ZStack {
if clerk.user != nil {
UserButton()
.frame(width: 36, height: 36)
}
}
}
}struct ContentView: View {
@Environment(\.clerk) private var clerk
var body: some View {
NavigationView {
VStack {
Text("Welcome!")
}
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
if clerk.user != nil {
UserButton()
.frame(width: 36, height: 36)
}
}
}
}
}
}Customization
To learn how to customize Clerk iOS views, see the dedicated guide.
If Clerk's prebuilt views don't meet your specific needs or if you require more control over the logic, you can rebuild the existing Clerk flows using the Clerk API. For more information, see the custom flow guides.
Feedback
Last updated on