// 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 {
Base component

Avatar

Theme-aware, responsive avatar component.

18 props0 slots3 eventsTheme readyResponsive
Interactive playground

Configure Avatar

Change any prop and inspect the server-rendered component immediately.

Live preview
Component code
<Avatar
  src="/avatar-example.svg"
  alt="Example profile portrait"
  size="xs"
/>
Component props18 controls
Live examples

Designed for real product surfaces

Compare configurations and resize the browser to check responsive behavior.

Size & shape

Extra-small circular avatar

Render one circular profile image at the documented size.

01
Live preview
Component usage.wrn
<Avatar
  src="/avatar-example.svg"
  alt="Example profile portrait"
  size="xs"
/>
Size & shape

Small circular avatar

Render one circular profile image at the documented size.

02
Live preview
Component usage.wrn
<Avatar
  src="/avatar-example.svg"
  alt="Example profile portrait"
  size="sm"
/>
Size & shape

Medium circular avatar

Render one circular profile image at the documented size.

03
Live preview
Component usage.wrn
<Avatar
  src="/avatar-example.svg"
  alt="Example profile portrait"
/>
Size & shape

Large circular avatar

Render one circular profile image at the documented size.

04
Live preview
Component usage.wrn
<Avatar
  src="/avatar-example.svg"
  alt="Example profile portrait"
  size="lg"
/>
Size & shape

Extra-large circular avatar

Render one circular profile image at the documented size.

05
Live preview
Component usage.wrn
<Avatar
  src="/avatar-example.svg"
  alt="Example profile portrait"
  size="xl"
/>
Size & shape

Rounded avatars

Apply softly rounded corners when a circle is not the right fit.

06
Live preview
Component usage.wrn
<Avatar
  src="/avatar-example.svg"
  alt="Example rounded profile portrait"
  size="lg"
  shape="rounded"
/>
Status

Circular avatars with top status

Place a clear presence indicator at the requested avatar edge.

07
Live preview
Component usage.wrn
<Avatar
  src="/avatar-example.svg"
  alt="Avery Chen"
  size="lg"
  status="online"
  statusLabel="Online"
  statusPosition="top"
/>
Status

Circular avatars with bottom status

Place a clear presence indicator at the requested avatar edge.

08
Live preview
Component usage.wrn
<Avatar
  src="/avatar-example.svg"
  alt="Avery Chen"
  size="lg"
  status="away"
  statusLabel="Away"
/>
Fallbacks

Avatars with brand icons

Overlay a service or platform icon to identify a linked account.

09
Live preview
Component usage.wrn
<Avatar
  src="/avatar-example.svg"
  alt="Linked profile"
  size="lg"
  badgeIcon="icon-[lucide--message-square]"
  badgeLabel="Messaging account"
/>
Fallbacks

Placeholder icon

Show a generic person icon when no profile image is available.

010
Live preview
Component usage.wrn
<Avatar
  alt="Anonymous profile"
  size="lg"
  variant="soft"
/>
Fallbacks

Placeholder initials

Use initials as an accessible text fallback for a missing image.

011
Live preview
Component usage.wrn
<Avatar
  alt="Avery Chen"
  initials="AC"
  size="lg"
/>
Color variants

Solid color variants

Use the solid treatment across semantic avatar colors.

012
Live preview
Component usage.wrn
<Avatar
  alt="Avery Chen"
  initials="AC"
  size="lg"
  color="success"
/>
Color variants

Soft color variants

Use the soft treatment across semantic avatar colors.

013
Live preview
Component usage.wrn
<Avatar
  alt="Avery Chen"
  initials="AC"
  size="lg"
  color="info"
  variant="soft"
/>
Color variants

Outline color variants

Use the outline treatment across semantic avatar colors.

014
Live preview
Component usage.wrn
<Avatar
  alt="Avery Chen"
  initials="AC"
  size="lg"
  color="danger"
  variant="outline"
/>
Color variants

White color variants

Use the white treatment across semantic avatar colors.

015
Live preview
Component usage.wrn
<Avatar
  alt="Avery Chen"
  initials="AC"
  size="lg"
  variant="white"
/>
Composition

Avatar with tooltip

Reveal a name or extra context on hover and keyboard focus.

016
Live preview
Component usage.wrn
<Avatar
  src="/avatar-example.svg"
  alt="Avery Chen"
  size="lg"
  status="online"
  tooltip="Avery Chen · Online"
  name="Avery Chen"
/>
Composition

Media object

Combine an avatar with supporting text for profile and activity rows.

017
Live preview
Component usage.wrn
<Avatar
  src="/avatar-example.svg"
  alt="Mark Wanner"
  size="lg"
  name="Mark Wanner"
  description="mark@example.com"
/>
Component events

Events

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.
Event listener.js
const component = document.querySelector('[data-wrn-events]')

component.addEventListener('load', (event) => {
  console.log(event.detail)
})
Component API

Props and configuration

All content and behavior shown above is supplied through these props and slots.

PropTypeDefaultRequired
srcstring""No
altstring""No
initialsstring""No
sizestring"md"No
colorstring"primary"No
variantstring"solid"No
shapestring"circle"No
statusstring""No
statusLabelstring""No
statusPositionstring"bottom"No
badgestring""No
badgeIconstring""No
badgeLabelstring""No
tooltipstring""No
namestring""No
descriptionstring""No
loadingstring"lazy"No
classstring""No
} }