ProfileAvatar

Displays a user's private avatar image with profile initials and editable image-selection actions.

Install

Run the following command to install the profile avatar block:

npx acc-nuxt add ProfileAvatar

Preview

Default

Editable

Local draft

Profile data

Without a userUuid, the block reads the current authenticated user's profile with useProfile(). Pass a UUID to load another profile when the authenticated user has permission to access it.

When the profile contains an avatarKey, useProfile() resolves the private CDN URL as userProfile.avatarUrl. The user's first and last name initials are used when no avatar key or private URL is available.

In editable mode, an authenticated user can select one image and preview it locally. The avatar-file-change event provides the selected file information to a containing form to upload or remove; the block does not submit profile changes itself.

Use mode="local" with editable for invitation forms. This skips profile fetching and allows image selection, preview, and removal without signing in. The preview is preserved when auth state changes. Keep the file from avatar-file-change and upload it after confirmInvite() succeeds.

Dropzone validation errors are emitted as error with a reason, message, and optional file name. Invalid files are rejected without changing the current preview. Render the message in the containing form; the custom avatar trigger does not show Dropzone's built-in error UI. Set dropzoneProps.maxFileSize to enforce a file-size limit.

Props

userUuid:string— optional
UUID of the profile to display. Defaults to the currently authenticated user. Ignored in local mode.
editable:boolean— optional
default:false
Enables profile-picture hover actions. Image selection requires an authenticated user in profile mode and is available before sign-in in local mode.
mode:'profile' | 'local'— optional
default:'profile'
Profile mode loads the selected user profile. Local mode skips profile fetching and preserves the local preview when auth state changes.
avatarProps:AcceleratorAvatar props excluding profile-managed values— optional
Props forwarded to the composed Avatar, such as its size.
tooltipProps:AccTooltipProps— optional
Props forwarded to the composed Tooltip, such as direction and delays.
dropzoneProps:Omit<AccDropzoneProps, "multiple" | "accept" | "maxFiles" | "disabled">— optional
Props forwarded to Dropzone while its single-image behavior and disabled state remain controlled by the block.

Bindings

v-model:string | undefined
The resolved avatar source URL. Removing the profile picture sets it to undefined.

Emits

@avatar-file-change="AccDropzoneFileInfo | null"
Emitted with the selected image file information, or null when the profile picture is removed.
@error="AccDropzoneErrorPayload"
Forwards Dropzone validation errors. The current image is preserved; the containing form handles the message.