Skip to main content
Version: Next

Avatar API

import { Avatar } from '@editora/ui-react';

Props​

PropTypeDescription
altstring
badgestring
bgstring
colorstring
disabledboolean
elevation'none' | 'low' | 'high'
fontWeightnumber | string
initialsstring
interactiveboolean
loading'lazy' | 'eager' | boolean
onAvatarError(detail: { src: string }) => void
onAvatarLoad(detail: { src: string }) => void
radiusnumber | string
ringboolean
shape'circle' | 'rounded' | 'square'
sizenumber | string | 'sm' | 'md' | 'lg' | '1' | '2' | '3'
srcstring
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