Skip to main content
Urbicon UI

Avatar

User profile images with fallback initials, status indicators, and configurable shapes.

Playground

JD
Shape Style variant (tailwind-variants)
Status Position Style variant (tailwind-variants)
<Avatar
  name="Jane Doe"
  size="lg"
  status=""
/>

01 Examples

Team Row

Overlapping avatars with a children-based overflow counter — the standard way to show a member list in a row that has no room for one.
A
B
C
D
+5
<div class="flex -space-x-3">
  <Avatar name="Anna" size="lg" randomColor ring ringIntent="neutral" />
  <Avatar name="Ben" size="lg" randomColor ring ringIntent="neutral" />
  <Avatar name="Cleo" size="lg" randomColor ring ringIntent="neutral" />
  <Avatar name="Dan" size="lg" randomColor ring ringIntent="neutral" />
  <Avatar
    unstyled
    class="bg-surface-elevated text-text-secondary ring-surface-base flex h-12 w-12 items-center justify-center rounded-full text-xs font-semibold ring-2"
  >
    +5
  </Avatar>
</div>

Custom Children

Use children to render arbitrary content instead of auto-generated initials — an icon for a system account, a count for a group, a glyph for a placeholder.
42
!
<Avatar size="xl" intent="primary">
  <UserIcon size={24} />
</Avatar>
<Avatar size="xl" intent="success">
  <span class="text-lg">42</span>
</Avatar>
<Avatar size="xl" intent="warning" variant="rounded">
  <span class="text-base">!</span>
</Avatar>

Mint micro-interactions

Mints only apply when the avatar is interactive (clickable, interactive, or onclick). Recommended: scale and glow — they read as 'this profile is tappable' without being playful. Avoid bounce, rotate, and wiggle on profile pictures — they undermine the calm a face conveys.
S
G
S
<Avatar name="Scale" clickable mint="scale" size="lg" />
<Avatar name="Glow" clickable mint="glow" intent="primary" size="lg" />
<Avatar name="Static" clickable size="lg" />

02 Customization

Gradient Avatar

Use unstyled with children for fully custom styling.
FD
AK
ST
<Avatar
  unstyled
  class="flex h-14 w-14 items-center justify-center rounded-full bg-linear-to-br from-violet-500 to-fuchsia-500 text-lg font-bold text-white shadow-lg shadow-violet-500/25"
>
  FD
</Avatar>
<Avatar
  unstyled
  class="flex h-14 w-14 items-center justify-center rounded-full bg-linear-to-br from-cyan-500 to-blue-500 text-lg font-bold text-white shadow-lg shadow-cyan-500/25"
>
  AK
</Avatar>
<Avatar
  unstyled
  class="flex h-14 w-14 items-center justify-center rounded-2xl bg-linear-to-br from-amber-400 to-orange-500 text-lg font-bold text-neutral-900 shadow-lg shadow-amber-500/25"
>
  ST
</Avatar>

Beyond unstyled + class, Avatar exposes base, frame, image, fallback, and status through slotClasses. A recurring identity treatment — like the gradient tiles above — is best registered as a BlocksProvider preset (presets.Avatar) and applied via preset; see Customization.

03 Accessibility

ARIA

The aria-label is derived from alt or name. Interactive avatars receive role="button". Purely decorative avatars can be hidden via aria-hidden.

Keyboard

Interactive avatars are focusable via Tab and activate with Enter / Space. Non-interactive avatars are skipped in the tab order.

Image Fallback

When the image fails to load, the component falls back to children (if provided) or initials generated from name, ensuring content is always visible.

04 API Reference

25 props
25 props
Prop
Type
Default
Description

05 Types

Local type definitions used by this component.

7 types
Name
Kind
Category
Used by
Description

06 Installation

Import

import { Avatar } from '@urbicon-ui/blocks';