Avatar API
import { Avatar } from '@editora/ui-react';
Props
| Prop | Type | Description |
|---|---|---|
alt | string | |
badge | string | |
bg | string | |
color | string | |
disabled | boolean | |
elevation | 'none' | 'low' | 'high' | |
fontWeight | number | string | |
initials | string | |
interactive | boolean | |
loading | 'lazy' | 'eager' | boolean | |
onAvatarError | (detail: { src: string }) => void | |
onAvatarLoad | (detail: { src: string }) => void | |
radius | number | string | |
ring | boolean | |
shape | 'circle' | 'rounded' | 'square' | |
size | number | string | 'sm' | 'md' | 'lg' | '1' | '2' | '3' | |
src | string | |
state | 'idle' | 'loading' | 'error' | 'success' | |
status | 'online' | 'offline' | 'busy' | 'away' | |
tone | 'neutral' | 'brand' | 'info' | 'success' | 'warning' | 'danger' | brand uses the theme's primary colour (as on Badge). |
variant | 'surface' | 'soft' | 'solid' | 'outline' |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Element: <ui-avatar>
Avatar renders the ui-avatar custom element from @editora/ui-core, which can also be used without React.
Attributes: alt, badge, bg, color, disabled, elevation, fontweight, headless, initials, interactive, loading, radius, ring, shape, size, src, state, status, tone, variant
Events: avatar-error, avatar-load, error, load