Pixel Avatar
betaA deterministic pixel avatar generated from a seed — crisp SVG, coloured from theme tokens, with a gentle shimmer.
- Display
- 1 file
- 1 npm package
- Accessibility notes
Loading the example…
pnpm dlx @dowel-ui/cli add pixel-avatarnpm packages installed: class-variance-authority.
import { PixelAvatar } from "@/components/ui/pixel-avatar";Default
Gallery
Shapes And Density
<PixelAvatar>
| Prop | Type | Default |
|---|---|---|
seed (required)Any string — a name, an id. The same seed always draws the same avatar. | string | — |
animatedShimmer, sparkle and breathe. Stops under reduced motion either way. | boolean | true |
cellsPixels per side. | number | 6 |
paletteReplaces the three token-derived colours with any CSS colours. | [string, string, string] | — |
shape | "circle" | "square" | "circle" |
sizeRendered size. A number is pixels; a string is any CSS length. | number | string | 64 |
Plus every attribute of <svg> except children.
Decorative by default (aria-hidden), for the usual case of an avatar beside a visible name. Pass aria-label — the agent's name, not the seed — to make it role="img". The shimmer is decoration and stops under reduced motion, leaving the resting grid.
7/7
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — does not apply
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes