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
Aisha Khan · Product designer
Component code
<Avatar
  alt="Aisha Khan"
  initials="AK"
  tooltip="Aisha Khan · Product designer"
  name="Aisha Khan"
/>
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
Aisha Khan · Product designer
Component usage.wrn
<Avatar
  alt="Aisha Khan"
  initials="AK"
  tooltip="Aisha Khan · Product designer"
  name="Aisha Khan"
/>
Dense UI

Compact application

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

02
Live preview
Aisha Khan · Product designer
Component usage.wrn
<Avatar
  alt="Aisha Khan"
  initials="AK"
  size="sm"
  tooltip="Aisha Khan · Product designer"
  name="Aisha Khan"
/>
Extended

Rich configuration

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

03
Live preview
Aisha Khan · Product designer Aisha Khan Product designer
Component usage.wrn
<Avatar
  alt="Aisha Khan"
  initials="AK"
  status="online"
  tooltip="Aisha Khan · Product designer"
  name="Aisha Khan"
  description="Product designer"
/>
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