Create an avatar style with Figma
DiceBear Studio, our plugin for Figma, is the easiest way to create an avatar style for DiceBear.
This guide covers its Build tab and assumes basic Figma knowledge. The plugin overview covers the other tabs.
The screenshots build a small style called "shape-face" out of two component groups, face and eyes, with a color group for each. Your style can have as many groups as you like, the steps stay the same.
Step 1: Create the color styles
If you want DiceBear to change the colors of your avatar, create the colors as color styles in Figma. With nothing selected, the Design panel shows a Styles section, and its plus button creates a new style.
Name every color <group>/<option-name>, for example face/yellow. The slash puts the colors into groups, and each group becomes one color option of your style. DiceBear later picks a color from the group, depending on the seed and the settings. For <group> and <option-name> you can use letters, digits and hyphens.

Step 2: Assign the colors
Assign a color from one of the groups to every path that should be colored dynamically. Which color of the group you pick does not matter, only the group counts.

Step 3: Turn the parts into components
Turn the individual parts of your avatar into components. Name them with the same <group>/<option-name> pattern, for example face/rectangle, then right-click and choose Create component.
A component group works like a color group: DiceBear picks one component from it for every avatar, depending on the seed and the settings.

Step 4: Give each group one size
Every component of a group needs the same width and height. The fastest way is to select all components of a group and set the size once, which changes all of them together.
Step 5: Assemble the frame
Create as many color and component groups as you like, then bring everything together in one frame. Its width and height must be identical, and Clip content should be on.

Open the Assets panel and drag one instance from each component group into the frame. The plugin reads the group from the instance, so which variant you pick does not matter.

The frame now holds one instance per group.

Step 6: Set up the style in the plugin
Select the frame, then start the DiceBear Studio plugin. The quickest way is the Actions search in the toolbar.

The plugin opens on the tab you used last. Switch to the Build tab in the rail on the left. With your frame selected, the tab shows the settings of your style: the title, the license, and one entry per component group and color group. Everything you change here is saved on your frame, so it is there again the next time you open the plugin.

Every component group has four tabs. Settings holds the probability with which the component appears at all, and the ranges for rotation, translation and scale that DiceBear picks from. Weights make one variant more likely than another. Tags describe a variant, for example mood:positive, so that a user of your style can filter variants when rendering. Normalize trims every variant of the group to the same frame size and keeps the drawing where it is. A color group has two settings: whether its color must contrast with another group, and which groups it must not share a color with.

When you are happy with your settings, click Export definition.
Step 7: Use your style
The plugin exports a JSON file: your style definition. It works right away, without a build step. Test it with the CLI, which writes 10 sample avatars into ./test-output:
dicebear create ./your-style.json -o ./test-output --count 10The libraries load it like any other style:
import { Style, Avatar } from '@dicebear/core';
import definition from './your-style.json' with { type: 'json' };
const style = new Style(definition);
const avatar = new Avatar(style, {
seed: 'dicebear',
// ... other options
});use DiceBear\Avatar;
use DiceBear\Style;
$style = Style::fromJson(file_get_contents('./your-style.json'));
$avatar = new Avatar($style, [
'seed' => 'dicebear',
// ... other options
]);from pathlib import Path
from dicebear import Avatar, Style
style = Style.from_json(Path("./your-style.json").read_text("utf-8"))
avatar = Avatar(style, {
"seed": "dicebear",
# ... other options
})use dicebear_core::{Avatar, Style};
use serde_json::json;
use std::fs;
let definition = fs::read_to_string("./your-style.json")?;
let style = Style::from_str(&definition)?;
let avatar = Avatar::new(&style, json!({
"seed": "dicebear",
// ... other options
}))?;import (
"os"
dicebear "github.com/dicebear/dicebear-go/v11"
)
definition, _ := os.ReadFile("./your-style.json")
style, _ := dicebear.NewStyle(definition)
avatar, _ := dicebear.NewAvatar(style, map[string]any{
"seed": "dicebear",
// ... other options
})import 'dart:io';
import 'package:dicebear_core/dicebear_core.dart';
final style = Style.parse(File('./your-style.json').readAsStringSync());
final avatar = Avatar(style, {
'seed': 'dicebear',
// ... other options
});using System.Text.Json.Nodes;
using DiceBear;
var style = Style.Parse(File.ReadAllText("./your-style.json"));
var avatar = new Avatar(style, new JsonObject
{
["seed"] = "dicebear",
// ... other options
});dicebear create ./your-style.json -o ./avatar.png --seed "dicebear"dicebear create ./your-style.json --help lists every option the CLI reads from your definition.
To use the style in Figma itself, upload the definition to the library of the plugin's Generate tab. It is then available in every file you open, see Use your own styles.