Twitter2.3k

Avatar

An image element with a fallback for representing the user.

RGRGRGRGRG+3

Installation

ng g @spartan-ng/cli:ui avatar

Usage

import { HlmAvatarImports } from '@spartan-ng/helm/avatar';
<hlm-avatar>
   <img hlmAvatarImage src='/assets/avatar.png' alt='spartan logo. Resembling a spartanic shield' />
   <span hlmAvatarFallback>RG</span>
</hlm-avatar>

Examples

Basic

A basic avatar component with an image and a fallback.

RG

Badge

Use the hlm-avatar-badge component to add a badge to the avatar. The badge is positioned at the bottom right of the avatar.

RG

Badge Icon

You can also use an icon inside hlm-avatar-badge .

RG

Avatar Group

Use the hlm-avatar-group component to add a group of avatars.

RGRGRG

Avatar Group Count

Use hlm-avatar-group-count to add a count to the group.

RGRGRG+3

Avatar Group Icon

You can also use an icon inside hlm-avatar-group-count

RGRGRG

Sizes

Use the size prop to change the size of the avatar.

RGRGRG

Dropdown

You can use the hlm-avatar component as trigger for a dropdown menu.

Brain API

BrnAvatar

Selector: brn-avatar

BrnAvatarFallback

Selector: [brnAvatarFallback]

ExportAs: avatarFallback

BrnAvatarImage

Selector: img[brnAvatarImage]

ExportAs: avatarImage

Helm API

HlmAvatarBadge

Selector: [hlmAvatarBadge],hlm-avatar-badge

HlmAvatarFallback

Selector: [hlmAvatarFallback]

ExportAs: avatarFallback

HlmAvatarGroupCount

Selector: [hlmAvatarGroupCount],hlm-avatar-group-count

HlmAvatarGroup

Selector: [hlmAvatarGroup],hlm-avatar-group

HlmAvatarImage

Selector: img[hlmAvatarImage]

ExportAs: avatarImage

HlmAvatar

Selector: hlm-avatar

Inputs

PropTypeDefaultDescription
size 'default' | 'sm' | 'lg' default -
Badge Autocomplete