Try It Live
Type any string, name, email, or ID and get a deterministic avatar instantly.
Generated palette
Slot selections
"ahmed"
Usage
import { generateAvatar } from "@brick-avatars/core";
const { svg, palette, selections } =
generateAvatar({
seed: "ahmed",
});SVG output
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256">
<rect width="256" height="256" fill="#FFFFFF" rx="12"/>
<path d="M83.1206 24.0515C83.1206 19.5277 86.7879 15.8604 91.3118 15.8604H161.346C165.87 15.8604 169.538 19.5277 169.538 24.0515V49.0346H83.1206V24.0515Z" f…Everything you need
A complete avatar system designed for production use — from a single function call to a full HTTP API.
Deterministic
Same seed always produces the same avatar. No randomness at render time — perfect for user profiles, consistent IDs, and reproducible tests.
SVG-First
Pure SVG output with a 256×256 viewBox. Scales to any resolution with zero pixelation. Embed inline, use in an <img>, or serve as a file.
Zero Dependencies
The entire core package has no runtime dependencies. Tiny bundle footprint. Works in Node, Bun, Deno, Cloudflare Workers, and the browser.
Modular Slots
Eyes and mouth are always on; optional hair, facial hair, glasses, and freckles. Each slot is independently hashed. Adding new variants never changes existing avatars. Extend with your own components.
Hundreds of combinations
Sets of eyes, mouths, hair, facial hair, glasses, and freckles. Every combination feels distinct and recognizable.
Truly Isomorphic
One API across all JS runtimes. Import in the browser, run in a Worker, call from a CLI, or integrate into an HTTP API — identical output everywhere. (Soon)
Dead simple API
One function. Three deployment targets. Zero configuration.
import { generateAvatar } from "@brick-avatars/core";
// Basic usage
const { svg, palette, selections } = generateAvatar({
seed: "ahmed",
});
// Set it as innerHTML
document.getElementById("avatar").innerHTML = svg;
// Custom size (scales the SVG)
const big = generateAvatar({ seed: "ahmed", size: 256 });
// Override palette colors
const custom = generateAvatar({
seed: "ahmed",
palette: { hair: "#3B82F6", accent: "#EF4444" },
});