Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-avatar>

@methane-ui/ui~6.8 KB brotli (cold + Lit)~1.4 KB marginal

User or entity avatar supporting image loading with error fallback to computed initials or default silhouette, shape presets, and presence status.

When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-avatar> (@methane-ui/ui)
Ready · interact with <mth-avatar>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/avatar"></script>
<mth-avatar size="xs" shape="circle">Example</mth-avatar>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
srcsrcstring""Image URL for the avatar.
altaltstring""Alternative text describing the avatar image.
namenamestring""Full name used to compute initials fallback and accessible label.
sizesize'xs' | 'sm' | 'md' | 'lg' | 'xl'"md"Avatar dimension preset (xs | sm | md | lg | xl).
shapeshape'circle' | 'square'"circle"Avatar frame geometry (circle | square).
statusstatus'' | 'online' | 'busy' | 'away' | 'offline'""Optional presence status indicator (online | busy | away | offline).

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="none".lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
statesExposes ElementInternals CustomStateSet flags: :state(loaded), :state(error).Conformance suite
i18nRoutes 5 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test