Skip to content

Repository files navigation

heads

heads

Features

  • 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 128×128 viewBox. Scales to any resolution with zero pixelation. Embed inline, use in an <img>, or serve as a file.
  • Modular slots — head, eyes, eyebrows, mouth — each slot is independently hashed. Adding new variants never changes existing avatars. Extend with your own components.

Quick Start

pnpm add @brick-avatars/core
import { generateAvatar } from "@brick-avatars/core";

const { svg } = generateAvatar({ seed: "ahmed" });
// svg is a complete <svg>...</svg> string ready to use

That's it.

Control the output size

The default size is 256px. Pass size to change the pixel dimensions — the internal 128x128 viewBox scales automatically.

// Thumbnail
const small = generateAvatar({ seed: "ahmed", size: 32 });

// High-res profile picture
const large = generateAvatar({ seed: "ahmed", size: 512 });

Both produce identical artwork, only the width and height attributes differ.

Author: Ahmed Abouelleil

About

Brick like avatars generation API

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages