Display
Avatar
A person or entity, as an image with graceful fallbacks and an optional presence dot.
Installation #
With the Nuxt module, every component is auto-imported — there is nothing to add. In a plain Vue project, import what you use:
Copy
import { JAvatar } from '@juxtui/ui'Usage #
Copy
<JAvatar src="/ada.jpg" name="Ada Lovelace" status="online" />The image fades in once it has loaded. Until then — or if it fails — initials from name are shown, then a neutral glyph.
The status ring takes the colour of the surface behind it. Inside a JCard it adapts automatically; elsewhere set --j-avatar-ring.
Variants & examples #
Sizes and shapes#
Status#
Stacked#
API #
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| src | string | — | Image URL. |
| name | string | — | Full name — used for initials and the accessible name. |
| alt | string | — | Accessible name override. Defaults to name. |
| size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'md' | 20, 24, 32, 40 or 56px. |
| shape | 'circle' | 'square' | 'circle' | Square suits teams and organisations. |
| status | 'online' | 'away' | 'busy' | 'offline' | — | Presence dot. |
Slots
| Slot | Props | Description |
|---|---|---|
| fallback | — | Custom fallback content. |
Accessibility #
- Exposed as
role="img"with the name — and status, when set — as its label, e.g. “Ada Lovelace (Online)”. - Without a name the avatar is decorative.