Client component

Avatar

User images with graceful fallbacks, status badges, and overlapping groups.

Import#

import { Avatar } from "astralis-ui";
// Avatar.Group, Avatar.Badge

Usage#

The fallback chain is automatic: src image → initials from name (with a hue derived deterministically from the name, so the same person always gets the same color) → silhouette icon. Avatar.Badge anchors a status dot.

Groups#

+2

Sizes and shapes#

Props#

PropTypeDefaultDescription
src / altstringNoneThe image, with its alt text.
namestringNoneDrives initials and the deterministic hue.
iconReactNodesilhouetteCustom fallback when no image or name.
size"xs" | "sm" | "md" | "lg" | "xl" | "2xl""md"Diameter.
shape"circle" | "rounded" | "square""circle"Outline shape.
colorSchemeall 15 schemesfrom nameExplicit hue override.
ringbooleanfalseBorder ring (automatic inside a Group).

Avatar.Group#

PropTypeDefaultDescription
maxnumberNoneHow many avatars to show; the rest collapse into a +N chip.
size"xs" | "sm" | "md" | "lg" | "xl" | "2xl""md"Applied to every avatar in the group.
spacingnumber-8Overlap between avatars, in pixels. Negative values overlap.

Avatar.Badge#

PropTypeDefaultDescription
status"online" | "away" | "busy" | "offline""online"Preset dot color.
colorstringNoneCustom dot color, overriding status.
size"xs" | "sm" | "md" | "lg" | "xl" | "2xl"NoneDot size. Taken from the avatar it sits in.