Browse docsAvatar

SurfacesNew

Glass Avatar

A round photo that falls back to initials, with a presence dot and stacked groups.

Preview

Demos ready. Update 0.

Installation

For React 19+ apps with Tailwind CSS 4.

npx shadcn@4.14.1 add @glassyui/glass-avatar

Adds 5 files to components/glassyui and installs @radix-ui/react-avatar and clsx.

Usage

Usage

import { GlassAvatar } from "@/components/glassyui/glass-avatar";

export function PersonDemo() {
  return <GlassAvatar name="Ada Lovelace" src="/ada.jpg" status="online" />;
}

Examples

A stacked group

<GlassAvatarGroup max={4} aria-label="Team">
  {people.map((person) => (
    <GlassAvatar key={person} name={person} />
  ))}
</GlassAvatarGroup>

API reference

GlassAvatar

A span with role img, named by alt or name plus its status; the photo uses Radix Avatar inside it.

PropTypeDefaultDescription
namestringNoneThe person's name; supplies the initials and a stable initials colour.
srcstringNoneImage URL; the initials show until it loads, or if it fails.
altstringnameAccessible name of the avatar.
fallbackReactNodeinitials of nameReplaces the initials.
size'xs' | 'sm' | 'md' | 'lg' | 'xl''md'Diameter; ignored inside a GlassAvatarGroup, which sizes its avatars.
status'online' | 'away' | 'busy' | 'offline'NoneA presence dot on the corner, also added to the accessible name.

Also accepts HTML span attributes, except children.

GlassAvatarGroup

A div with role group that overlaps its avatars.

PropTypeDefaultDescription
childrenReactNodeNoneGlassAvatar elements, placed directly inside the group.
maxnumberNoneShows this many avatars, then a +N avatar for the rest.
size'xs' | 'sm' | 'md' | 'lg' | 'xl''md'Sizes every avatar in the group, overriding each avatar's own size.

Also accepts HTML div attributes.

Types
GlassAvatarPropsGlassAvatarSizeGlassAvatarStatusGlassAvatarGroupProps
Accessibility
Name each GlassAvatarGroup with aria-label; the avatar announces its name and status.