Avatar | UI Showcase
WRNexus UI
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
A polished default avatar for a modern application.
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
A polished default avatar for a modern application.
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
A compact configuration for dashboards and dense product surfaces.
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
A richer configuration demonstrating additional content and hierarchy.
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