BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/better-auth-ui/user-profile

User Profile

better-auth-ui/user-profile
FreeComponent

A form component for editing user profile information including name and avatar.

Live preview

live · rendered by the registry
Rendered by better-auth-ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://better-auth-ui.com/r/user-profile.json

Source

src/components/auth/settings/account/user-profile.tsxbetter-auth-ui.com/r/user-profile.json
1"use client"
2
3import {
4 type AdditionalFieldValue,
5 parseAdditionalFieldValue
6} from "@better-auth-ui/core"
7import {
8 type UsernameAuthClient,
9 useAuth,
10 useSession,
11 useUpdateUser
12} from "@better-auth-ui/react"
13import { type SyntheticEvent, useState } from "react"
14import { toast } from "sonner"
15
16import { Button } from "@/components/ui/button"
17import { Card, CardContent, CardFooter } from "@/components/ui/card"
18import { Field, FieldError, FieldLabel } from "@/components/ui/field"
19import { Input } from "@/components/ui/input"
20import { Skeleton } from "@/components/ui/skeleton"
21import { Spinner } from "@/components/ui/spinner"
22import { cn } from "@/lib/utils"
23import { AdditionalField } from "../../additional-field"
24import { ChangeAvatar } from "./change-avatar"
25
26export type UserProfileProps = {
27 className?: string
28}
29
30/**
31 * Render a profile card that lets the authenticated user view and update their display name, username, and avatar.
32 *
33 * @param className - Optional additional CSS class names applied to the card container
34 * @returns A JSX element containing the profile card with avatar upload and editable name/username fields
35 */
36export function UserProfile({ className }: UserProfileProps) {
37 const { additionalFields, authClient, localization } = useAuth()
38 const { data: session } = useSession(authClient as UsernameAuthClient)
39
40 const { mutate: updateUser, isPending } = useUpdateUser(authClient, {
41 onSuccess: () => toast.success(localization.settings.profileUpdatedSuccess)
42 })
43
44 const [fieldErrors, setFieldErrors] = useState<{
45 name?: string
46 }>({})
47
48 async function handleSubmit(e: SyntheticEvent<HTMLFormElement>) {
49 e.preventDefault()
50
51 const formData = new FormData(e.currentTarget)
52 const name = formData.get("name") as string
53
54 const additionalFieldValues: Record<string, unknown> = {}
55
56 for (const field of additionalFields ?? []) {
57 if (field.profile === false || field.readOnly) continue
58 const value = parseAdditionalFieldValue(
59 field,
60 formData.get(field.name) as string | null
61 )
62
63 if (field.validate) {
64 try {
65 await field.validate(value)
66 } catch (error) {
67 toast.error(error instanceof Error ? error.message : String(error))
68 return
69 }
70 }
71
72 // `null` = explicit clear (forward to backend); `undefined` = omitted.
73 if (value !== undefined) {
74 additionalFieldValues[field.name] = value
75 }
76 }
77
78 updateUser({
79// … truncated

What it pulls in

npm packages

  • @better-auth-ui/react@latest
  • @better-auth-ui/core@latest
  • @tanstack/react-pacer
  • better-auth
  • lucide-react

Other registry items

  • button
  • card
  • dropdown-menu
  • field
  • input
  • input-group
  • skeleton
  • sonner
  • spinner
  • https://better-auth-ui.com/r/radix-nova/additional-field.json
  • https://better-auth-ui.com/r/radix-nova/user-avatar.json

Files it writes

  • src/components/auth/settings/account/user-profile.tsx
  • src/components/auth/settings/account/change-avatar.tsx

Facts

Registry
better-auth-ui
Type
registry:component
Access
Free
Files written
2
Licence
MIT
In the index
at or before 2026-08-12
Last confirmed
yesterday

Go to the source

Docs on better-auth-ui better-auth-ui.com better-auth-ui/better-auth-ui on GitHub Raw registry item This item as JSON

More from better-auth-ui

All 49 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Account Settingsaccount-settingsbetter-auth-uiComponentsFree2 deps
Active Sessionsactive-sessionsbetter-auth-uiComponentsFree5 deps · 2 files
Additional Fieldadditional-fieldbetter-auth-uiComponentsFree5 deps
Adminadminbetter-auth-uiComponentsFree4 deps · 3 files
Anonymousanonymousbetter-auth-uiComponentsFree4 deps · 3 files
API Keyapi-keybetter-auth-uiComponentsFree4 deps · 10 files
Authauthbetter-auth-uiComponentsFree2 deps
Auth Providerauth-providerbetter-auth-uiComponentsFree4 deps · 2 files

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex