Kodama 木魅

Tiny spirits, born from strings.
Always alive.

Kodama (/koˈdama/) is an open-source avatar system that generates unique characters from any string. Unlike traditional avatars, every Kodama is fully animated — blinking, floating, glancing — right out of the box. 145,152 unique combinations ensure no two avatars look alike.

Quick Start

Try it out — enter a name, adjust the options, and watch the avatar update live.
Drop it into your project with the API or React component.

  • Name
  • Background -
  • Shape - -
  • Detail - - -
  • Depth - - -
  • Mood - - - - -
  • Animations - - - - - -

API

Generate avatars as SVG over HTTP. The name is the URL path — all options go in the query string.

<img src="https://api.kodama.sh/kodama?animations=blink" />

React

Import the Kodama component and pass a name string. Props match the API parameters.

import { Kodama } from "kodama-id/react";

<Kodama
  name="kodama"
  size={48}
  animations={["blink"]}
/>

Deterministic

Avatars are derived from a hash of the input string — the same name always produces the same face. Fully deterministic, with nothing stored or fetched.

"alice" - always identical
Different names, different faces

145,152 Combinations

Faces are assembled from 6 eye styles x 4 eyebrow types x 7 mouths x 2 cheek options x 3 accessories x 16 colors x 9 rotations.

  • Eyesround - cross - line - curved - wink - heart
  • Mouthssmile - grin - o - cat - tongue - smirk - flat
  • Eyebrowsarched - flat - raised - none
  • Cheeksblush - none
  • Accessoriesglasses - sunglasses - none

Colors

Sixteen soft pastel gradients with radial rendering for a subtle 3D appearance.
Pass in a custom gradients array to use your own palette.

Lavender
Peach
Mint
Sky
Coral
Butter
Sage
Blush
Sand
Ice
Orchid
Steel
Cream
Iris
Rose
Fern

Variants

Variants are pluggable visual styles. Each variant defines its own set of props — moods, animations, detail levels, and more. Pass a variant factory directly or pre-configure it with a descriptor.

import { faces } from "kodama-id/variants";

// Pass directly — configure via props
<Kodama name="luna" variant={faces} background="solid" mood="happy" />

// Or pre-configure with a descriptor
<Kodama name="luna" variant={faces({ background: "solid", detailLevel: "full" })} />
Faces
?
More soon...

Moods

Set a mood to give the avatar a specific expression, regardless of the generated features.

<Kodama name="user" mood="happy" />
<Kodama name="user" mood="cool" />
HappyCurved eyes, grin
SurprisedRound eyes, O mouth
SleepyLine eyes, flat mouth
CoolSunglasses, smirk
CheekyWink, tongue, blush

Animations

Pass an animations array to bring avatars to life. All animations are CSS-based and injected on demand — combine freely. Pass a string for defaults, or an object with type, delay, and duration for custom timing.

<Kodama
  name="sprite"
  animations={["blink", "float", "sway", "eyeWander"]}
/>

// With custom timing
<Kodama
  name="sprite"
  animations={[
    "blink",
    { type: "float", duration: 4, delay: 0.5 },
  ]}
/>
blink
float
sway
eyeWander
eyebrowBounce
glance
entrance
combined

Shape

Choose between a circle, squircle, or square clip for the avatar.

<Kodama name="user" shape="circle" />
<Kodama name="user" shape="squircle" />
<Kodama name="user" shape="square" />
circle
squircle
square

3D Effects

Four depth levels for CSS 3D perspective transforms. The face tilts based on the deterministic rotation. In React, the face flattens on hover when interactive is enabled.

<Kodama name="user" depth="dramatic" />
none
subtle
medium
dramatic

Detail Levels

Feature visibility automatically adapts to size. Smaller avatars show fewer features for clarity. Override with the detailLevel prop.

minimal< 32px - eyes only
basic32-48px - + mouth
standard48-64px - + eyebrows
full>= 64px - all features

Custom Gradients

Replace the default palette with your own gradient pairs via the gradients prop. The API accepts hex pairs like E8D5F5-C7A4E0,FFE0D0-FFB899.

const brand = [
  { from: "#667EEA", to: "#764BA2" },
  { from: "#F093FB", to: "#F5576C" },
];

<Kodama name="user" gradients={brand} />

Reference

Props and API params share the same names. In the API, name is the URL path — all others are query params.

Global

Prop / ParamTypeDefaultDescription
namestring-Input string for deterministic generation. API: URL path segment.
sizenumber40 / 128Avatar dimensions in pixels. React default: 40. API default: 128.
shape"circle" | "squircle" | "square""circle"Avatar clipping shape. Squircle uses Apple-style continuous curvature.
variant"faces""faces"Variant plugin to use for rendering.
interactiveREACTbooleantrueEnable hover interaction

Faces

Prop / ParamTypeDefaultDescription
background"gradient" | "solid""gradient"Background style
mood"happy" | "surprised" | "sleepy" | "cool" | "cheeky"-Override expression
detailLevel"minimal" | "basic" | "standard" | "full"autoFeature visibility level. Adapts to size by default.
depth"none" | "subtle" | "medium" | "dramatic""dramatic"3D perspective transform depth
animationsAnimation<"blink" | "float" | "sway" | "eyeWander" | "eyebrowBounce" | "glance" | "entrance">[][]String or { type, delay?, duration? }. API: comma-separated strings.
gradientsGradientPair<{ from: string, to: string }>[]-Custom gradient palette. API: hex pairs like E8D5F5-C7A4E0,FFE0D0-FFB899
Kodama — Deterministic, animated, open-source avatars.