Avatar
On this page
Overview
Provides a circular user thumbnail for mastheads, cards, and attribution when
you need to visually identify a person. Allows an image, a deterministic
pattern, or a default icon. Must not take focus or act as a control; images
carry role="presentation". Authors should provide a name via the
default slot so screen readers have context.
Edit element properties
rh-avatar::part(img) {
object-position: top;
}
import '@rhds/elements/rh-avatar/rh-avatar.js';
<rh-avatar name="Omar Khayyam" subtitle="Mathematician, Astronomer" src="khayyam.jpg"></rh-avatar>
import { Avatar } from "@rhds/elements/react/rh-avatar/rh-avatar.js";
// NOTE: React 19+ does not require these wrapper imports.
// You can use the custom elements directly as-is.
export const Demo = () => (
<Avatar name="Omar Khayyam" subtitle="Mathematician, Astronomer" src="khayyam.jpg" />
);
URL to a custom avatar image. Replaces the default icon and any
generated pattern. The <img> has role="presentation".
The user's display name. Falls back as default slot content and
seeds the deterministic pattern generator when pattern is set.
Auxiliary text such as job title or company. Falls back as default
content in the subtitle slot.
Thumbnail position relative to text: 'inline' (default, left of text)
or 'block' (stacked above). Both collapse to centered block below 576px.
Type of geometric pattern ('squares' or 'triangles'). Generated
deterministically from name so the same name always yields the same
pattern. Colors come from the --_colors CSS custom property.
When true, visually hides the name and subtitle via CSS clip while keeping them accessible to screen readers.
Adds a subtle border around the thumbnail when set to 'bordered'.
Status
- Figma library:
-
Ready - RH Elements:
-
Ready - RH Shared Libs:
-
Ready
When to use
- When you need to represent a user who has not provided a photo or image
Status checklist
| Property | Status | Meaning |
|---|---|---|
| Figma library |
|
Component is available in the Figma library |
| RH Elements |
|
Component is available in RH Elements |
| RH Shared Libs |
|
Component is available in RH Shared Libs |
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.