Extra-small circular avatar
Render one circular profile image at the documented size.
<Avatar
src="/avatar-example.svg"
alt="Example profile portrait"
size="xs"
/>
// Generated by scripts/generate-showcase.mjs. Do not edit directly.
page AvatarDetail {
layout = "showcase"
state playground_src = ctx.url.searchParams.get("pg_src") ?? "/avatar-example.svg"
state playground_alt = ctx.url.searchParams.get("pg_alt") ?? "Example profile portrait"
state playground_initials = ctx.url.searchParams.get("pg_initials") ?? ""
state playground_size = ctx.url.searchParams.get("pg_size") ?? "xs"
state playground_color = ctx.url.searchParams.get("pg_color") ?? "primary"
state playground_variant = ctx.url.searchParams.get("pg_variant") ?? "solid"
state playground_shape = ctx.url.searchParams.get("pg_shape") ?? "circle"
state playground_status = ctx.url.searchParams.get("pg_status") ?? ""
state playground_statusLabel = ctx.url.searchParams.get("pg_statusLabel") ?? ""
state playground_statusPosition = ctx.url.searchParams.get("pg_statusPosition") ?? "bottom"
state playground_badge = ctx.url.searchParams.get("pg_badge") ?? ""
state playground_badgeIcon = ctx.url.searchParams.get("pg_badgeIcon") ?? ""
state playground_badgeLabel = ctx.url.searchParams.get("pg_badgeLabel") ?? ""
state playground_tooltip = ctx.url.searchParams.get("pg_tooltip") ?? ""
state playground_name = ctx.url.searchParams.get("pg_name") ?? ""
state playground_description = ctx.url.searchParams.get("pg_description") ?? ""
state playground_loading = ctx.url.searchParams.get("pg_loading") ?? "lazy"
state playground_class = ctx.url.searchParams.get("pg_class") ?? ""
seo {
title = "Avatar"
description = "Theme-aware, responsive avatar component."
}
view {
Theme-aware, responsive avatar component. Change any prop and inspect the server-rendered component immediately.Avatar
Configure Avatar
<Avatar
src="/avatar-example.svg"
alt="Example profile portrait"
size="xs"
/>
Compare configurations and resize the browser to check responsive behavior.
Render one circular profile image at the documented size.
<Avatar
src="/avatar-example.svg"
alt="Example profile portrait"
size="xs"
/>
Render one circular profile image at the documented size.
<Avatar
src="/avatar-example.svg"
alt="Example profile portrait"
size="sm"
/>
Render one circular profile image at the documented size.
<Avatar
src="/avatar-example.svg"
alt="Example profile portrait"
/>
Render one circular profile image at the documented size.
<Avatar
src="/avatar-example.svg"
alt="Example profile portrait"
size="lg"
/>
Render one circular profile image at the documented size.
<Avatar
src="/avatar-example.svg"
alt="Example profile portrait"
size="xl"
/>
Apply softly rounded corners when a circle is not the right fit.
<Avatar
src="/avatar-example.svg"
alt="Example rounded profile portrait"
size="lg"
shape="rounded"
/>
Place a clear presence indicator at the requested avatar edge.
<Avatar
src="/avatar-example.svg"
alt="Avery Chen"
size="lg"
status="online"
statusLabel="Online"
statusPosition="top"
/>
Place a clear presence indicator at the requested avatar edge.
<Avatar
src="/avatar-example.svg"
alt="Avery Chen"
size="lg"
status="away"
statusLabel="Away"
/>
Overlay a service or platform icon to identify a linked account.
<Avatar
src="/avatar-example.svg"
alt="Linked profile"
size="lg"
badgeIcon="icon-[lucide--message-square]"
badgeLabel="Messaging account"
/>
Show a generic person icon when no profile image is available.
<Avatar
alt="Anonymous profile"
size="lg"
variant="soft"
/>
Use initials as an accessible text fallback for a missing image.
<Avatar
alt="Avery Chen"
initials="AC"
size="lg"
/>
Use the solid treatment across semantic avatar colors.
<Avatar
alt="Avery Chen"
initials="AC"
size="lg"
color="success"
/>
Use the soft treatment across semantic avatar colors.
<Avatar
alt="Avery Chen"
initials="AC"
size="lg"
color="info"
variant="soft"
/>
Use the outline treatment across semantic avatar colors.
<Avatar
alt="Avery Chen"
initials="AC"
size="lg"
color="danger"
variant="outline"
/>
Use the white treatment across semantic avatar colors.
<Avatar
alt="Avery Chen"
initials="AC"
size="lg"
variant="white"
/>
Reveal a name or extra context on hover and keyboard focus.
<Avatar
src="/avatar-example.svg"
alt="Avery Chen"
size="lg"
status="online"
tooltip="Avery Chen · Online"
name="Avery Chen"
/>
Combine an avatar with supporting text for profile and activity rows.
<Avatar
src="/avatar-example.svg"
alt="Mark Wanner"
size="lg"
name="Mark Wanner"
description="mark@example.com"
/>
Public events declared by this component. Custom events bubble from the component root and expose state through event.detail.
@loadFires when component data or media finishes loading.@errorFires when the component encounters an error.@clickFires when the component is activated by pointer or keyboard.const component = document.querySelector('[data-wrn-events]')
component.addEventListener('load', (event) => {
console.log(event.detail)
})All content and behavior shown above is supplied through these props and slots.
| Prop | Type | Default | Required |
|---|---|---|---|
src | string | "" | No |
alt | string | "" | No |
initials | string | "" | No |
size | string | "md" | No |
color | string | "primary" | No |
variant | string | "solid" | No |
shape | string | "circle" | No |
status | string | "" | No |
statusLabel | string | "" | No |
statusPosition | string | "bottom" | No |
badge | string | "" | No |
badgeIcon | string | "" | No |
badgeLabel | string | "" | No |
tooltip | string | "" | No |
name | string | "" | No |
description | string | "" | No |
loading | string | "lazy" | No |
class | string | "" | No |