Back to componentszyra-avatar
Avatar
Profile and team visuals that make lists, comments, and user surfaces feel more human and scannable.
Component preview
Explore the available states and the real library behavior for this component.
zyra-avatar Playground
Avatar component with initials, image support, status indicator and variants
Controls
name
size
variant
shape
src (image)
online
Live Preview md teal
Generated Code
<zyra-avatar name="Arjun Kumar" size="md" variant="teal" />
Sizes 5 sizes
Color Variants 5 variants
Online Status
Shapes
Image & Fallback auto fallback on error

Real World — Team List
Arjun KumarLead Developer
Priya SharmaUI Designer
Rohit VermaBackend Engineer
Sneha PatelProduct Manager
Dev ZyraQA Engineer
Avatar Group — Stacked
+3
Copy-paste example
Drop this into your Angular standalone component and it works out of the box.
import { Component } from '@angular/core';
import { ZyraAvatar } from 'zyra-ng-ui';
@Component({
selector: 'app-demo-avatar',
standalone: true,
imports: [ZyraAvatar],
template: `
<zyra-avatar
name="Ava Patel"
size="lg"
variant="purple"
[online]="true"
/>
`,
})
export class DemoAvatarComponent {}
Variants
All the visual modes and states available for this component.
tealDefault accent-teal initials background
blueBlue initials background
purplePurple initials background
warmWarm amber initials background
neutralNeutral grey initials background
API
All inputs and configuration options for zyra-avatar.
| Prop | Type | Default | Description |
|---|---|---|---|
name | string | - | Full name used to generate initials and aria-label |
src | string | - | Image URL; falls back to initials when not provided or broken |
size | 'sm' | 'md' | 'lg' | 'xl' | 'md' | Diameter of the avatar |
variant | 'teal' | 'blue' | 'purple' | 'warm' | 'neutral' | 'teal' | Background color for initials fallback |
online | boolean | false | Shows a green presence indicator dot |
Accessibility
Built to meet WCAG 2.0 AA. These notes cover the key ARIA, keyboard, and interaction behaviours.
- The name prop is used as the accessible aria-label for screen readers
- Image avatars include a meaningful alt attribute derived from name
- Presence indicator dot is decorative; status should be conveyed in text elsewhere