data-display — wyrd.component.avatar

Avatar

Circular identity image with deterministic initials fallback.

Install @wyrd-company/react or the Flutter package and use it directly — your DESIGN.md does the styling.

01

Examples

Generated from the contract's examples block. Previews are the published @wyrd-company/react component, themed by the brand's role tokens — flip the site's light/dark toggle and they follow.

Code target Applies to every example on component pages.
initials state: fallback
Usage
import { WyrdAvatar } from "@wyrd-company/react";

<WyrdAvatar name="Bob Langley" size="sm" />
image state: image
Katelyn Langley
Usage
import portraitUrl from "../example-assets/workbench-portrait.png";
import { WyrdAvatar } from "@wyrd-company/react";

export function ImageAvatarExample() {
  return <WyrdAvatar name="Mara Voss" size="lg" src={portraitUrl} />;
}
large state: fallback
Usage
import { WyrdAvatar } from "@wyrd-company/react";

<WyrdAvatar name="Wyrd Company" size="lg" />
02

Properties

NameTypeDefaultSummary
src string undefined Optional image URL.
name string undefined Person or entity name used for the accessible name and fallback initials.
size sm | md | lg md Visual avatar size.
03

Tokens

The contract's token bindings. Open the shared contextual sidebar from any example; primary swatches reflect the color you pick there. Error swatches show the active preset's values; editing any knob switches to custom and resets error to TWW · Ink.

BindingToken
background color.secondary
foreground color.on-secondary
size.sm spacing.lg
size.md spacing.xl
size.lg 64px
radius rounded.full
label typography.label-md
04

States

StateSourceSummary
image property Avatar image is rendered from src.
fallback platform Deterministic initials are shown when no image is available.
05

Accessibility

From the contract's accessibility obligations. Role img; Name property provides the accessible name.

  • When src is provided, the image alt text is the name property.
  • The fallback initials are hidden from the accessibility tree; the avatar remains named by the name property.
  • Verified under: rtl, cvd-deuteranopia, density-compact, text-expansion.
06

SDUI

Status: serializable. Avatar serializes image source, name, and size; each target handles image failure locally.

SerializableMembers
Propertiessrc, name, size
Slots
Events
The Wyrding Way — a contract-first design system. © Wyrd Company