Base JS behaviour

Avatar

The avatar with initials (the image fallback), an online/away/busy status ring and four sizes.

Real scenarios

The component as it is used in a product — not a specimen grid.

The on-call roster, with presence

The ring says it before the text does: green online, red busy, amber away — and no ring for the rest. The name doubles as the aria label.

  • مریم صادقی Product designer now
  • سامان دهقان Backend engineer in a call
  • Nguyen Linh Support lead 12 min ago
  • هانیه کاظمی Data analyst 3 days ago

Square tiles for integrations

shape="square" turns the avatar into an app tile; initials replace missing logos.

Sizes, one face

xs to xl with the status ring scaling along; hover a face — its name is the tooltip here.

Latin names take the first letters of both words; Persian too — no fake photos needed.

Important props

Important props
Prop Type Default What it does
name string — The full name; its initials become both the content and the aria label.
src string null Photo; if it fails to load it falls back to the initials without a refresh.
status string null online · away · busy · offline — the colored ring at the avatar’s foot.
size / shape string md / circle Sizes xs · sm · md · lg · xl and a square shape for app grids.

Snippet

<x-nx::avatar name="نگار رستمی" status="online" size="lg" />

<x-nx::avatar name="سامان دهقان" shape="square" />