Avatar

Overview Style Guidelines Code Demos Accessibility
  1. Installation
  2. Usage
  3. rh-avatar
  1. Installation
  2. Usage
  3. rh-avatar

Installation

Usage

  <rh-avatar></rh-avatar>

rh-avatar

Slots 2
Slot Name Description

The subject's name

subtitle

auxiliary information about the subject, e.g. job title

Attributes 7
DOM Property Description Type Default
src

The URL to the user's custom avatar image.

It will be displayed instead of a random pattern.

string | undefined
unknown
name

The user's name, either given name and family name, or username.

When displaying a pattern, the name will be used to seed the pattern generator.

string | undefined
unknown
subtitle

The auxiliary information about the user, e.g. job title

string | undefined
unknown
layout

The type of pattern to display.

'inline' | 'block' | undefined
unknown
pattern

The type of pattern to display.

'squares' | 'triangles' | undefined
unknown
plain

When true, hides the title and subtitle

boolean
false
on
ColorTheme | undefined
unknown
Methods 1
Method Name Description
updatePattern()
Events 0

None

CSS Shadow Parts 0

None

CSS Custom Properties 2
CSS Property Description Default
--rh-avatar-colors

List of colors to use when generating avatars

--rh-avatar-size

Size of the avatar,

64px
Design Tokens 25

Token Copy
--rh-border-radius-pill
--rh-color-blue-30
--rh-color-blue-50
--rh-color-green-60
--rh-color-green-70
--rh-color-interactive-primary-default-on-dark
--rh-color-interactive-primary-default-on-light
--rh-color-interactive-primary-hover-on-dark
--rh-color-interactive-primary-hover-on-light
--rh-color-interactive-primary-visited-default-on-dark
--rh-color-interactive-primary-visited-default-on-light
--rh-color-purple-60
--rh-color-purple-70
--rh-color-red-40
--rh-color-red-50
--rh-color-teal-50
--rh-color-teal-70
--rh-color-text-secondary-on-dark
--rh-color-text-secondary-on-light
--rh-font-family-heading
--rh-font-size-body-text-sm
--rh-font-weight-heading-medium
--rh-font-weight-heading-regular
--rh-size-icon-06
--rh-space-lg