Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

DiceBear avatar styles

This repository contains all official avatar style definitions for DiceBear. An avatar style definition is a JSON file that describes how to create an avatar. It contains all necessary information like available elements and colors. The JSON files are ideal for creating avatars in different programming languages with the corresponding DiceBear wrapper. The JSON schema for the avatar style definitions can be found in the @dicebear/schema package.

Generate definitions

Most of the JSON files were created using the DiceBear Exporter for Figma. The used Figma files are linked in the figma folder. Files created with this plugin are marked accordingly and should not be adjusted manually, but exported again with the Figma plugin.

Usage

JavaScript

npm install @dicebear/styles
import adventurer from '@dicebear/styles/adventurer.json' with { type: 'json' };
import lorelei from '@dicebear/styles/lorelei.json' with { type: 'json' };

PHP

composer require dicebear/styles
$basePath = \Composer\InstalledVersions::getInstallPath('dicebear/styles');

$adventurer = json_decode(file_get_contents($basePath . '/src/adventurer.json'), true);
$lorelei    = json_decode(file_get_contents($basePath . '/src/lorelei.json'), true);

Python

pip install dicebear-styles
import json
from importlib.resources import files

adventurer = json.loads(files('dicebear_styles').joinpath('adventurer.json').read_text('utf-8'))
lorelei    = json.loads(files('dicebear_styles').joinpath('lorelei.json').read_text('utf-8'))

Rust

Each style is gated behind a feature of the same name, so a binary only embeds the styles it opts into (use the all feature to pull in every style):

cargo add dicebear-styles --features adventurer,lorelei

The enabled styles are embedded at compile time and exposed as raw JSON (&'static str). Parse them with serde_json:

use dicebear_styles::{ADVENTURER, LORELEI};

let adventurer: serde_json::Value = serde_json::from_str(ADVENTURER)?;
let lorelei: serde_json::Value = serde_json::from_str(LORELEI)?;

// Or look one up by name at runtime (None if unknown or its feature is off):
let style = dicebear_styles::get("adventurer");

// all() lists every style compiled into this build.
let all = dicebear_styles::all();

Go

go get github.com/dicebear/styles/v10

Every style is embedded at compile time and exposed as raw JSON (string), both as an exported variable and by name via Get. Parse it with encoding/json:

import (
	"encoding/json"

	styles "github.com/dicebear/styles/v10"
)

var adventurer map[string]any
_ = json.Unmarshal([]byte(styles.Adventurer), &adventurer)

// Or look one up by name (ok is false if the style is unknown):
raw, ok := styles.Get("lorelei")

// All() lists every embedded style.
all := styles.All()

Dart

dart pub add dicebear_styles

Each style is a Dart string constant in its own library, so a compiled app only embeds the styles it imports. Parse the raw JSON with dart:convert:

import 'dart:convert';

import 'package:dicebear_styles/adventurer.dart';
import 'package:dicebear_styles/lorelei.dart';

final adventurerStyle = jsonDecode(adventurer);
final loreleiStyle = jsonDecode(lorelei);

Or import the umbrella library, which pulls in every style and adds a runtime lookup by name:

import 'package:dicebear_styles/dicebear_styles.dart' as styles;

// null if the style is unknown:
final raw = styles.get('adventurer');

// `all` lists every embedded style.
final names = styles.all;

C#

dotnet add package DiceBear.Styles

Every style is embedded in the assembly and exposed as raw JSON (string), both as a property and by name via Get. Parse it with System.Text.Json:

using System.Text.Json;
using DiceBear;

var adventurer = JsonDocument.Parse(Styles.Adventurer);

// Or look one up by name (null if the style is unknown):
var raw = Styles.Get("lorelei");

// All() lists every embedded style.
var all = Styles.All();

Each property reads its resource on every call, so hand the text to whatever parses it once and keep that result rather than the raw string.

Contributing

See CONTRIBUTING.md for local development, testing, and the release process.

License

Each avatar style is under its own license, named in the definition file itself. The language shims, the build scripts and the package manifests are under the MIT license. Both parts are spelled out in LICENSE.md.

Sponsors

Advertisement: Many thanks to our sponsors who provide us with free or discounted products.

bunny.net

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dicebear_styles-11.0.0rc1.tar.gz (779.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dicebear_styles-11.0.0rc1-py3-none-any.whl (820.3 kB view details)

Uploaded Python 3

File details

Details for the file dicebear_styles-11.0.0rc1.tar.gz.

File metadata

  • Download URL: dicebear_styles-11.0.0rc1.tar.gz
  • Upload date:
  • Size: 779.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dicebear_styles-11.0.0rc1.tar.gz
Algorithm Hash digest
SHA256 37834f5f3bb905b58a9ef4b5e437eaab536ceceb4044b70d1f64fae050e91595
MD5 c8a68834d05a89a50a97ca92bb1ba882
BLAKE2b-256 74bda5db02d78901991971951ad4a7d21200dadc6e56ada842917bc9f99fac80

See more details on using hashes here.

Provenance

The following attestation bundles were made for dicebear_styles-11.0.0rc1.tar.gz:

Publisher: publish.yml on dicebear/styles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dicebear_styles-11.0.0rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for dicebear_styles-11.0.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 bf24e6899f21388ed6874515ec318ddee25258c5b9236edf827e0cfba12e7b0f
MD5 04132ef8547cd3d5de2a0560ebea8d30
BLAKE2b-256 a6bce62f27503e807b652db43850e1bf9d7bbff8f2d98032d75b92b79f88b005

See more details on using hashes here.

Provenance

The following attestation bundles were made for dicebear_styles-11.0.0rc1-py3-none-any.whl:

Publisher: publish.yml on dicebear/styles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

11.0.0rc1 This release

2 files

10.6.0

2 files

10.5.0

2 files

10.4.0

2 files

10.3.0

2 files

10.2.0

2 files

10.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page