// Generated by scripts/generate-showcase.mjs. Do not edit directly. page AvatarDetail { layout = "showcase" state playground_src = ctx.url.searchParams.get("pg_src") ?? "" state playground_alt = ctx.url.searchParams.get("pg_alt") ?? "" state playground_initials = ctx.url.searchParams.get("pg_initials") ?? "" state playground_size = ctx.url.searchParams.get("pg_size") ?? "md" 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") ?? "Avatar" 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") ?? "Avatar" 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") ?? "A polished default avatar for a modern application." state playground_loading = ctx.url.searchParams.get("pg_loading") ?? "lazy" state playground_class = ctx.url.searchParams.get("pg_class") ?? "showcase-instance showcase-instance--1" seo { title = "Avatar" description = "Theme-aware, responsive avatar component." } view {
Base component

Avatar

Theme-aware, responsive avatar component.

18 props0 slots3 outputsTheme readyResponsive
Interactive playground

Configure Avatar

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

Live preview
Component code
<Avatar
  statusLabel="Avatar"
  badgeLabel="Avatar"
  description="A polished default avatar for a modern application."
/>
Event outputInteract with the preview to inspect the typed payload.
Component props18 controls
Live examples

Designed for real product surfaces

Compare configurations and resize the browser to check responsive behavior.

Recommended

Production default

Balanced spacing, hierarchy, and content for the most common product workflow.

01
Live preview
Component usage.wrn
<Avatar
  statusLabel="Avatar"
  badgeLabel="Avatar"
  description="A polished default avatar for a modern application."
/>
Dense UI

Compact application

A tighter variation for dashboards, side panels, tables, and operational interfaces.

02
Live preview
Component usage.wrn
<Avatar
  size="sm"
  variant="secondary"
  statusLabel="Compact example"
  badgeLabel="Compact example"
  description="A compact configuration for dashboards and dense product surfaces."
/>
Extended

Rich configuration

A more expressive variation using additional data, stronger emphasis, and optional states.

03
Live preview
Component usage.wrn
<Avatar
  size="lg"
  variant="success"
  statusLabel="Advanced example"
  badgeLabel="Advanced example"
  description="A richer configuration demonstrating additional content and hierarchy."
/>
Component outputs

Receive every typed component output

Use declarative output handlers in .wrn files or register a direct output handler from JavaScript. The canonical API exposes payload and does not require event.detail.

@loadFires after remote or deferred content loads successfully.
@errorFires when the component cannot complete an operation.
@clickFires when the interactive surface is activated.
Declarative handlers.wrn
<Avatar
  @load='console.log(payload)'
  @error='console.log(payload)'
  @click='console.log(payload)'
/>
Direct output handlers.js
import { registerOutputHandler } from "@wrnexus/csr/outputs"

const component = document.querySelector("[data-ui-component=\"Avatar\"], [data-component=\"Avatar\"]")

if (component) registerOutputHandler(component, "load", (payload) => {
  console.log("load", payload)
})

if (component) registerOutputHandler(component, "error", (payload) => {
  console.log("error", payload)
})

if (component) registerOutputHandler(component, "click", (payload) => {
  console.log("click", payload)
})
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
} }