import { WyrdAvatar } from "@wyrd-company/react";
<WyrdAvatar name="Bob Langley" size="sm" />import 'package:wyrd_flutter/wyrd_flutter.dart';
WyrdAvatar(
name: 'Bob Langley',
size: 'sm',
) data-display — wyrd.component.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.
$schema: https://thewyrdingway.dev/schemas/component-contract.schema.ymlcontractVersion: 0.1.0identity: name: Avatar tag: wyrd-avatar package: wyrd.component.avatar title: Avatar summary: Circular identity image with deterministic initials fallback.relationships: related-to: - quality-parity-and-gatesclassification: category: data-display composition: leaf interactive: falsetarget-strategy: react: required flutter: requiredsurface: properties: - name: src type: kind: string required: false serializable: true summary: Optional image URL. - name: name type: kind: string required: true serializable: true summary: Person or entity name used for the accessible name and fallback initials. - name: size type: kind: enum values: - sm - md - lg required: false default: md reflects: true serializable: true summary: Visual avatar size. slots: [] events: [] states: - name: image source: property summary: Avatar image is rendered from src. - name: fallback source: platform summary: Deterministic initials are shown when no image is available. parts: - name: root summary: Accessible image root. - name: image summary: Optional image element. - name: initials summary: Fallback initials text. tokens: background: color.secondary foreground: color.on-secondary size: sm: spacing.lg md: spacing.xl lg: 64px radius: rounded.full label: typography.label-mdmessages: []obligations: accessibility: role: img name: Name property provides the accessible name. keyboard: [] semantics: - 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. behavior: model: stateless interactions: - Fallback initials are the first letters of the first two whitespace-separated words, uppercased. - The fallback is shown when src is absent or image loading fails. hostEffects: [] conditions: - rtl - cvd-deuteranopia - density-compact - text-expansion sdui: status: serializable serializableProperties: - src - name - size serializableSlots: [] eventBindings: [] notes: Avatar serializes image source, name, and size; each target handles image failure locally.examples: - name: initials state: fallback properties: name: Bob Langley size: sm slots: {} - name: image state: image properties: name: Katelyn Langley size: md slots: {} - name: large state: fallback properties: name: Wyrd Company size: lg slots: {}
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.
import { WyrdAvatar } from "@wyrd-company/react";
<WyrdAvatar name="Bob Langley" size="sm" />import 'package:wyrd_flutter/wyrd_flutter.dart';
WyrdAvatar(
name: 'Bob Langley',
size: 'sm',
) 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} />;
}
import 'package:flutter/widgets.dart';
import 'package:wyrd_flutter/wyrd_flutter.dart';
Widget imageAvatarExample() => WyrdAvatar(
name: 'Mara Voss',
size: WyrdAvatarSize.lg,
src: 'asset:assets/examples/workbench-portrait.png',
);
Widget fallbackAvatarExample() =>
const WyrdAvatar(name: 'Mara Voss', size: WyrdAvatarSize.lg);
import { WyrdAvatar } from "@wyrd-company/react";
<WyrdAvatar name="Wyrd Company" size="lg" />import 'package:wyrd_flutter/wyrd_flutter.dart';
WyrdAvatar(
name: 'Wyrd Company',
size: 'lg',
) | Name | Type | Default | Summary |
|---|---|---|---|
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. |
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.
| Binding | Token | |
|---|---|---|
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 |
| State | Source | Summary |
|---|---|---|
image | property | Avatar image is rendered from src. |
fallback | platform | Deterministic initials are shown when no image is available. |
From the contract's accessibility obligations. Role img; Name property provides the accessible name.
Status: serializable. Avatar serializes image source, name, and size; each target handles image failure locally.
| Serializable | Members |
|---|---|
| Properties | src, name, size |
| Slots | — |
| Events | — |