Fallback
When src
or srcSet
are missing or fail to load, a fallback will be displayed. By default this will show the user initials, based on the name
. Optionally you can suppy your own content 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 | |
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 | |