Skip to main content

Avatar

Show a user’s profile image or initials in a compact, visual element.

string

An alternative text that describes the avatar for the reader to understand what it is about or identify the user the avatar belongs to.

string

Initials to display in the avatar.

"small" | "small-200" | "base" | "large" | "large-200"

Size of the avatar.

string

The URL or path to the image.

Initials will be rendered as a fallback if src is not provided, fails to load or does not load quickly

Was this section helpful?

Learn more about registering events.

OnErrorEventHandler
<typeof tagName> | null
Was this section helpful?

Code

<s-avatar
alt="John Doe"
initials="JD"
></s-avatar>

Preview