Avatar

Profile images with initials, status badges, overlapping groups and an account menu.

Installation

Install the shared package once in your Exact app. This version is a beta.
bun add --exact @rightui/ui@0.4.0-beta.4
The Exact compiler requires Bun 1.4.2, regardless of which package manager installs the package.
Complete the font, app metadata and root provider setup (required for both installation methods).
Import
use Avatar, AvatarFrame, AvatarBadge, AvatarStatus, AvatarGroup, AvatarGroupItem, AvatarGroupItemDirected, AvatarGroupCount, AvatarGroupOverflow, AvatarGroupOverflowDirected, AvatarMenu from "@rightui/ui"

Usage

Use AvatarFrame for an image and fallback, then compose AvatarStatus or AvatarBadge inside it. Group profiles with AvatarGroup and AvatarGroupItem. Sizes are sm, default and lg. AvatarMenu adds a keyboard-accessible account menu.

Examples

Basic

A profile image with a fallback when it cannot load.

Fallback

Initials remain visible when no image is supplied.

Badge

A small status indicator with an accessible label.

Badge with Icon

Add an icon inside the badge.

Avatar Group

Stack related profiles with a contrasting outline.

Avatar Group Count

Show how many additional people belong to the group.

Avatar Group with Icon

Use custom content in the overflow indicator.

Sizes

Small, default and large avatars share the same image and fallback behavior.

Dropdown

Open the account menu with a click or the keyboard.
Choose an account action

RTL

The same composition in a right-to-left layout.

Keyboard

AvatarMenu: Enter, Space or ArrowDown opens the menu; ArrowUp opens at the last enabled item. Arrow keys, Home, End and typing move focus. Enter or Space selects an item. Escape closes and returns focus to the avatar.

API Reference

Properties from the component source. State lives in your component; actions receive the updated value.
AvatarMenu.id
string
AvatarMenu.name
string
AvatarMenu.src
string
AvatarMenu.fallback
string
AvatarMenu.entries
MenuEntry[]
AvatarMenu.reduced
bool
AvatarMenu.choose
action
AvatarFrame.id
string
AvatarFrame.name
string
AvatarFrame.src
string
AvatarFrame.fallback
string
AvatarFrame.size
string
AvatarStatus.id
string
AvatarStatus.label
string
AvatarStatus.size
string
AvatarStatus.tone
string
AvatarBadge.id
string
AvatarBadge.label
string
AvatarBadge.size
string
AvatarGroup.id
string
AvatarGroup.label
string
AvatarGroupItemDirected.id
string
AvatarGroupItemDirected.first
bool
AvatarGroupItemDirected.direction
string
AvatarGroupOverflowDirected.id
string
AvatarGroupOverflowDirected.label
string
AvatarGroupOverflowDirected.size
string
AvatarGroupOverflowDirected.first
bool
AvatarGroupOverflowDirected.direction
string
AvatarGroupItem.id
string
AvatarGroupItem.first
bool
AvatarGroupOverflow.id
string
AvatarGroupOverflow.label
string
AvatarGroupOverflow.size
string
AvatarGroupOverflow.first
bool
AvatarGroupCount.id
string
AvatarGroupCount.label
string
AvatarGroupCount.count
number
AvatarGroupCount.size
string
AvatarGroupCount.first
bool
Avatar.id
string
Avatar.src
string
Avatar.name
string
Avatar.fallback
string