Avatar
On this page
Overview
Provides a small thumbnail representation of a user, including image and optional title and subtitle. Use when representing a specific person by image, name, and/or job title.
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" />
);
The URL to the user's custom avatar image.
It will be displayed instead of a random pattern.
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. When `plain` is set, the name and subtitle are used as accessible labels
Auxiliary information about the user. May be used to add job title, company, etc. When `plain` is set, the name and subtitle are used as accessible labels
Places avatar on the left or on top of the text.
The type of pattern to display.
When true, hides the title and subtitle
Adds a subtle border to the avatar image
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.