Skip to content
View as Markdown

Core options ​

These options work with every avatar style and in every DiceBear library. The HTTP API takes them as query parameters, except idRandomization, fontFamily, fontWeight and title. Only the syntax for passing them differs, and each library page shows its own.

Where the type lists [min, max], pass either a fixed value or a two-element range, and the seed picks a value within it.

OptionTypeDefaultDescription
seedstring''Seed for deterministic generation
flip'none' | 'horizontal' | 'vertical' | 'both''none'Flip the avatar (accepts an array of values to randomize)
rotatenumber | [min, max]0Rotation in degrees (−360 to 360)
scalenumber | [min, max]1Uniform scale factor around the canvas center (0 to 10, 1 is original size)
borderRadiusnumber | [min, max]0Border radius in percent of the canvas (0 to 50, 50 makes a circle)
sizeintegerunsetOutput size in pixels (1 to 4096). When unset, the SVG scales to its container
translateXnumber | [min, max]0Horizontal translation in percent of the canvas width (−1000 to 1000)
translateYnumber | [min, max]0Vertical translation in percent of the canvas height (−1000 to 1000)
idRandomizationbooleanfalseAdd a random suffix to every SVG id and animation name, so inlined avatars on one page don't collide
titlestringunsetAccessible title. When set, the SVG becomes role="img" with <title>
fontFamilystring | string[]'system-ui'Font family for text-based styles. A string is used as given, so 'Arial, Helvetica' works as a font stack (no quotes). A list picks one entry per seed
fontWeightinteger | integer[]400Font weight for text-based styles (1 to 1000)
tagsstring | string[]unsetKeep only variants matching these tags (category or category:value, prefix with ! to disallow)
animationbooleanfalsePlay the style's animations. Styles without animations ignore it
*AnimationbooleanunsetSwitch one animation by name, such as blinkAnimation: true. Wins over animation
animationSpeednumber | [min, max]1Playback speed factor (0.1 to 10, 2 plays twice as fast)
*AnimationSpeednumber | [min, max]unsetSpeed of one animation by name, such as blinkAnimationSpeed: 2. Wins over animationSpeed
animationDelaynumber | [min, max]0Start offset in seconds (−3600 to 3600), applied after the speed. As a range, every seed starts at its own moment
*AnimationDelaynumber | [min, max]unsetStart offset of one animation by name, such as blinkAnimationDelay: [0, 3]. Wins over animationDelay
animationRespectReducedMotionbooleantrueRespect the viewer's reduced motion setting through a prefers-reduced-motion media query. Turn it off for SVG renderers that ignore media queries, such as libraries in native apps

Background options ​

These options are available for every style, even ones that don't declare a background color group in their definition.

OptionTypeDefaultDescription
backgroundColorstring | string[]unsetBackground colors as hex (# optional, #RGB to #RRGGBBAA)
backgroundColorFill'solid' | 'linear' | 'radial''solid'Background fill type (accepts an array of values to randomize)
backgroundColorFillStopsinteger | [min, max]2Number of gradient stops (minimum 2), ignored when fill is solid
backgroundColorAnglenumber | [min, max]0Gradient angle in degrees (−360 to 360)
backgroundColorOrder'random' | 'fixed''random'Use the given colors in order (fixed) instead of shuffling them

Dynamic component options ​

For each component in a style (e.g. eyes, mouth, hair), the following options are available:

PatternTypeDescription
{component}Variantstring | string[] | { variant: weight }Restrict to specific variants, optionally with weights
{component}ProbabilitynumberVisibility probability in percent (0 to 100)

Components have no rotate, translate, or scale options. The style definition sets those ranges, and the seed picks from them.

A component alias (declared with extends in the style definition) has no options of its own. It shares {source}Variant and {source}Probability with the component it extends.

Dynamic color options ​

For each color group in a style (e.g. skin, hair) and background, the following options are available:

PatternTypeDescription
{color}Colorstring | string[]Override the palette with hex values (# optional)
{color}ColorFill'solid' | 'linear' | 'radial'Fill type (accepts an array of values to randomize)
{color}ColorFillStopsinteger | [min, max]Number of gradient stops (minimum 2), ignored when fill is solid
{color}ColorAnglenumber | [min, max]Gradient angle in degrees (−360 to 360)
{color}ColorOrder'random' | 'fixed'Use the given colors in order (fixed) instead of shuffling them

With {color}ColorOrder: 'fixed', the colors keep the order they are given in, from {color}Color or from the style's palette. Solid fills use the first color. Gradient fills use the colors as stops from first to last, with as many stops as colors unless you set {color}ColorFillStops. The style's contrastTo constraint is skipped, but notEqualTo still applies, so the result can still depend on the seed through the referenced color groups.