mica

Example

ANInitialsANBlobatarALSeed variantGHContainedMICustom sizePhoto avatar exampleImageAkonwi Ngohakonwi@example.com

Basic usage

<m-avatar role="img" aria-label="Akonwi Ngoh">AN</m-avatar>

<m-avatar>
  <img src="akonwi.jpg" alt="Akonwi Ngoh">
</m-avatar>

<m-avatar role="img" blobatar="akonwi" aria-label="Akonwi Ngoh">AN</m-avatar>

API

The wrapper accepts authored text or one direct image. Blobatar is an optional enhancement of that content.

Attributes

NameTypeDefaultDescription
blobatarstring seed

Generates deterministic color and facial features.

Requires avatar.js.
containedbooleanfalseInsets the generated body on the quiet surface. Only affects Blobatar paint.

Content

ContentContractDefaultDescription
TextinitialsRemains visible and meaningful without the optional module.
imgone direct childFills the square and crops with object-fit: cover. Its intrinsic aspect ratio does not change the avatar's square size.

Styling

PropertyValueDefaultDescription
--avatar-size<length>3remSets both the inline and block size. Initials scale with it.
--radius-md<length>themeControls the wrapper and generated body's corner shape.

avatar.js

Optional. Reads the blobatar seed and paints deterministic decoration using Blobatar's seed and contrast-safe palette utilities locally; it makes no image or identity request. Without it, authored initials remain intact.

<script type="module" src="mica/avatar.js"></script>

Accessibility

For initials or generated paint, give a standalone avatar role="img" and the person's name with aria-label. A native image carries its name in alt and needs no image role on the wrapper. When visible text alongside the avatar already identifies the person, use aria-hidden="true" on the wrapper and an empty alt on its image to avoid announcing the name twice. Generated paint is decorative; authored initials remain its semantic fallback. Use one visual source per avatar: an image or a blobatar seed.

← badgeskeleton →