Initials
Provide an initials array to define what part of the name is used to generate initials. Use index values to identify each desired name, and -1 to represent the last possible name.
Fallback
When src or srcSet are missing or fail to load, a fallback will be displayed using the default children. This can be used to display icons or even pass a Next.js image component.
Filters
Avatars can implement SVG Filters using arbitrary Tailwind syntax.
Style Attribute
Use the style prop to implement custom styles on the parent <figure> element.
Anatomy
<Avatar> image fallback API Reference
Avatar
| Property | Type | Description |
|---|---|---|
src | string | |
srcSet | string | |
name * | string | |
initials | number[] | |
base | string | |
background | string | |
size | string | |
font | string | |
border | string | |
rounded | string | |
shadow | string | |
classes | string | |
imageBase | string | |
imageClasses | string | |
fallbackBase | string | |
fallbackClasses | string | |
ids | Partial<{ root: string; image: string; fallback: string; }> | |
dir | "ltr" | "rtl" | |
getRootNode | () => ShadowRoot | Node | Document | |
onStatusChange | (details: StatusChangeDetails) => void | |
children | ReactNode | |
style | CSSProperties | |