@dicebear/schema 1.5.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -20,7 +20,7 @@ Only a safe subset of SVG elements and attributes is permitted. Event handlers,
20
20
 
21
21
  #### Additional documentation
22
22
 
23
- https://www.dicebear.com/specification/definition-schema/
23
+ https://www.dicebear.com/create-styles/definition-schema/
24
24
 
25
25
  ### `options.json`
26
26
 
@@ -40,6 +40,8 @@ Validates the options object passed by users when generating an avatar. Supporte
40
40
  | `idRandomization` | `boolean` | SVG ID randomization to avoid conflicts |
41
41
  | `fontFamily` | `string \| array` | Font family for text rendering |
42
42
  | `fontWeight` | `integer \| array` | Font weight (1 to 1000) |
43
+ | `animation` | `boolean \| string \| array` | Plays the style's declarative animations, all or by name |
44
+ | `animationSpeed` | `number \| [min, max]` | Playback speed multiplier (0.1 to 10, 1 = as authored) |
43
45
  | `*Probability` | `number` | Component display probability (0 to 100) |
44
46
  | `*Variant` | `string \| string[] \| object` | Component variant filter and weights |
45
47
  | `*Color` | `string \| array` | Hex colors |
@@ -179,8 +181,8 @@ var names = DiceBear.Schema.All();
179
181
  The schemas are available directly via CDN, so no installation is required. We recommend using a specific version to ensure stability:
180
182
 
181
183
  ```
182
- https://cdn.hopjs.net/npm/@dicebear/schema@1.5.1/dist/definition.min.json
183
- https://cdn.hopjs.net/npm/@dicebear/schema@1.5.1/dist/options.min.json
184
+ https://cdn.hopjs.net/npm/@dicebear/schema@1.6.0/dist/definition.min.json
185
+ https://cdn.hopjs.net/npm/@dicebear/schema@1.6.0/dist/options.min.json
184
186
  ```
185
187
 
186
188
  ## Contributing
@@ -1 +1 @@
1
- {"$id":"https://cdn.hopjs.net/npm/@dicebear/schema@1.5.1/dist/definition.min.json","$schema":"http://json-schema.org/draft-07/schema#","definitions":{"camelCaseName":{"description":"A camelCase identifier used for named things defined in the definition (colors, components, variants). Must start with a lowercase letter and may contain letters and digits.","type":"string","pattern":"^[a-z][a-zA-Z0-9]*$","maxLength":64},"colorName":{"description":"A reference to a color palette defined in the top-level `colors` section.","allOf":[{"$ref":"#/definitions/camelCaseName"}]},"componentName":{"description":"A reference to a component defined in the top-level `components` section.","allOf":[{"$ref":"#/definitions/camelCaseName"}]},"translateValue":{"description":"A translation value expressed as a percentage of the component's width (for `x`) or height (for `y`). Defines a range the PRNG picks from. Set `min === max` for a fixed value. A positive `step` quantizes the range to multiples of `step` starting at `min`; omit for a continuous range. When `(max - min)` is not a multiple of `step`, `max` itself is unreachable — the last bucket is clamped to `≤ max`.","type":"object","properties":{"min":{"type":"number","minimum":-1000,"maximum":1000},"max":{"type":"number","minimum":-1000,"maximum":1000},"step":{"type":"number","exclusiveMinimum":0,"maximum":2000}},"required":["min","max"],"additionalProperties":false},"hexColor":{"description":"A hex color with leading `#`, in 3, 4, 6, or 8 digit form.","type":"string","pattern":"^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$","maxLength":9},"colorValue":{"description":"A color value for `fill`, `stroke`, `stop-color`, and other color attributes. Either a plain string (any CSS color format — named color, hex, `rgb()`, `oklch()`, `color-mix()`, local paint server reference `url(#id)`, etc.) or an object referencing a named color palette defined in the top-level `colors` section. CSS color syntax is not validated; invalid colors are the browser's problem.","anyOf":[{"$ref":"#/definitions/attributeString"},{"description":"A reference to a named color palette. At render time, the PRNG selects a color value from the referenced palette.","type":"object","properties":{"type":{"const":"color"},"name":{"description":"The name of the color palette to reference.","$ref":"#/definitions/colorName"}},"required":["type","name"],"additionalProperties":false}]},"safeUrl":{"description":"A URL restricted to HTTP and HTTPS protocols.","type":"string","pattern":"^https?://","maxLength":2048},"filteredString":{"description":"Base definition for the filtered-string family (`attributeString`, `cssString`). Blocks a shared set of known-dangerous patterns: external `url(...)` references (local `url(#id)` is allowed), `expression()`, `behavior:`, `-moz-binding`, `javascript:` / `vbscript:` URI schemes, and backslash escape sequences. This is not a general CSS sanitizer — it is a defense-in-depth injection filter, so substring matches of blocked tokens will reject otherwise-harmless strings (e.g. a plain text containing the literal word `javascript:`). The `maxLength` here acts as an absolute ceiling for all derivatives; callers narrow it further. The separator between a blocked token and what follows is written out as a literal character class rather than `\\s`. Two reasons. Every regex engine reads `\\s` differently, so the shorthand made the same definition valid in one language and invalid in another. And `\\s` covers code points no parser skips, such as U+00A0, which widened the filter without adding protection. The class holds the five characters a URL or CSS parser actually discards between a token and what follows. The same five appear negated in the `url` pattern, where they mark that the URL body has not started, which is how a local `url(#id)` is told apart from an external reference. Do not fold either back into `\\s`.","type":"string","maxLength":16384,"not":{"type":"string","anyOf":[{"type":"string","pattern":"[uU][rR][lL][ \\t\\n\\f\\r]*\\([ \\t\\n\\f\\r]*[^#) \\t\\n\\f\\r]"},{"type":"string","pattern":"[eE][xX][pP][rR][eE][sS][sS][iI][oO][nN][ \\t\\n\\f\\r]*\\("},{"type":"string","pattern":"[bB][eE][hH][aA][vV][iI][oO][rR][ \\t\\n\\f\\r]*:"},{"type":"string","pattern":"-[mM][oO][zZ]-[bB][iI][nN][dD][iI][nN][gG]"},{"type":"string","pattern":"[jJ][aA][vV][aA][sS][cC][rR][iI][pP][tT][ \\t\\n\\f\\r]*:"},{"type":"string","pattern":"[vV][bB][sS][cC][rR][iI][pP][tT][ \\t\\n\\f\\r]*:"},{"type":"string","pattern":"\\\\"}]}},"attributeString":{"description":"The default value type for generic SVG attribute values — transform lists, numeric values, keywords, and so on. No syntactic validation; only the common `filteredString` injection filter applies.","type":"string","allOf":[{"$ref":"#/definitions/filteredString"}],"maxLength":1024},"pathDataString":{"description":"Used for the `d` attribute of `<path>`. Same filter as `attributeString`, but with a much larger length budget to accommodate complex path geometry.","type":"string","allOf":[{"$ref":"#/definitions/filteredString"}],"maxLength":16384},"cssString":{"description":"Used for inline `style` attribute content and `<style>` element bodies. Known-dangerous `@`-rules — `@import`, `@font-face`, `@document`, `@charset` — are rejected in addition to the common `filteredString` injection filter. Other `@`-rules (`@media`, `@keyframes`, `@supports`, `@layer`, etc.) are permitted, but the `filteredString` injection filter still applies to their contents — so external `url(...)` references inside e.g. an `@media` rule are still blocked. This is not a general CSS sanitizer.","type":"string","allOf":[{"$ref":"#/definitions/filteredString"}],"maxLength":4096,"not":{"type":"string","anyOf":[{"type":"string","pattern":"@[iI][mM][pP][oO][rR][tT]"},{"type":"string","pattern":"@[fF][oO][nN][tT]-[fF][aA][cC][eE]"},{"type":"string","pattern":"@[dD][oO][cC][uU][mM][eE][nN][tT]"},{"type":"string","pattern":"@[cC][hH][aA][rR][sS][eE][tT]"}]}},"element":{"description":"An SVG node. One of four mutually exclusive forms, discriminated by `type` (and `name` for the `<style>` special case): a text element, a component reference, a `<style>` element, or any other SVG element.","anyOf":[{"$ref":"#/definitions/textElement"},{"$ref":"#/definitions/componentReference"},{"$ref":"#/definitions/styleElement"},{"$ref":"#/definitions/genericElement"}]},"textElement":{"description":"A raw text node. Its `value` becomes the text content rendered into the parent element.","type":"object","properties":{"type":{"const":"text"},"value":{"description":"Either a plain string, or a `variable` reference resolved at render time to the seed's initials.","anyOf":[{"type":"string","maxLength":4096},{"type":"object","properties":{"type":{"const":"variable"},"name":{"enum":["initial","initials"]}},"required":["type","name"],"additionalProperties":false}]}},"required":["type","value"],"additionalProperties":false},"componentReference":{"description":"A reference to a named component defined in the top-level `components` section. At render time, the PRNG selects one of the component's variants. Optional `attributes` are applied to the generated `<use>` tag — most commonly a `transform` placing the instance, but any allowlisted attribute is accepted.","type":"object","properties":{"type":{"const":"component"},"name":{"$ref":"#/definitions/componentName"},"attributes":{"$ref":"#/definitions/attributes"}},"required":["type","name"],"additionalProperties":false},"styleElement":{"description":"An SVG `<style>` element. Its CSS content must be provided as `text` children; each child's value is validated as a CSS string with a stricter content policy than generic SVG attribute values.","type":"object","properties":{"type":{"const":"element"},"name":{"const":"style"},"attributes":{"$ref":"#/definitions/attributes"},"children":{"type":"array","items":{"type":"object","properties":{"type":{"const":"text"},"value":{"$ref":"#/definitions/cssString"}},"required":["type","value"],"additionalProperties":false},"maxItems":64}},"required":["type","name"],"additionalProperties":false},"genericElement":{"description":"Any SVG element other than `<style>`, which has its own stricter content policy.","type":"object","properties":{"type":{"const":"element"},"name":{"description":"The SVG tag name. Only a safe subset of SVG elements is permitted; dangerous elements such as `script`, `foreignObject`, or `a` are excluded.","enum":["circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","title","tspan","use","view"]},"attributes":{"$ref":"#/definitions/attributes"},"children":{"type":"array","items":{"$ref":"#/definitions/element"},"maxItems":1024}},"required":["type","name"],"additionalProperties":false},"attributes":{"description":"A map of allowed SVG presentation attributes. Only a safe subset is permitted; event handlers (e.g. `onclick`) and namespace attributes (e.g. `xlink:href`) are not allowed.","type":"object","properties":{"alignment-baseline":{"$ref":"#/definitions/attributeString"},"amplitude":{"$ref":"#/definitions/attributeString"},"azimuth":{"$ref":"#/definitions/attributeString"},"baseFrequency":{"$ref":"#/definitions/attributeString"},"baseline-shift":{"$ref":"#/definitions/attributeString"},"bias":{"$ref":"#/definitions/attributeString"},"class":{"$ref":"#/definitions/attributeString"},"clipPathUnits":{"$ref":"#/definitions/attributeString"},"clip-path":{"$ref":"#/definitions/attributeString"},"clip-rule":{"$ref":"#/definitions/attributeString"},"color":{"$ref":"#/definitions/colorValue"},"color-interpolation":{"$ref":"#/definitions/attributeString"},"color-interpolation-filters":{"$ref":"#/definitions/attributeString"},"crossorigin":{"$ref":"#/definitions/attributeString"},"cx":{"$ref":"#/definitions/attributeString"},"cy":{"$ref":"#/definitions/attributeString"},"d":{"$ref":"#/definitions/pathDataString"},"decoding":{"$ref":"#/definitions/attributeString"},"diffuseConstant":{"$ref":"#/definitions/attributeString"},"direction":{"$ref":"#/definitions/attributeString"},"display":{"$ref":"#/definitions/attributeString"},"divisor":{"$ref":"#/definitions/attributeString"},"dominant-baseline":{"$ref":"#/definitions/attributeString"},"dx":{"$ref":"#/definitions/attributeString"},"dy":{"$ref":"#/definitions/attributeString"},"edgeMode":{"$ref":"#/definitions/attributeString"},"elevation":{"$ref":"#/definitions/attributeString"},"exponent":{"$ref":"#/definitions/attributeString"},"fill":{"$ref":"#/definitions/colorValue"},"fill-opacity":{"$ref":"#/definitions/attributeString"},"fill-rule":{"$ref":"#/definitions/attributeString"},"filter":{"$ref":"#/definitions/attributeString"},"filterUnits":{"$ref":"#/definitions/attributeString"},"flood-color":{"$ref":"#/definitions/colorValue"},"flood-opacity":{"$ref":"#/definitions/attributeString"},"font-family":{"anyOf":[{"$ref":"#/definitions/attributeString"},{"type":"object","properties":{"type":{"const":"variable"},"name":{"const":"fontFamily"}},"required":["type","name"],"additionalProperties":false}]},"font-size":{"$ref":"#/definitions/attributeString"},"font-size-adjust":{"$ref":"#/definitions/attributeString"},"font-style":{"$ref":"#/definitions/attributeString"},"font-variant":{"$ref":"#/definitions/attributeString"},"font-weight":{"anyOf":[{"$ref":"#/definitions/attributeString"},{"type":"object","properties":{"type":{"const":"variable"},"name":{"const":"fontWeight"}},"required":["type","name"],"additionalProperties":false}]},"fx":{"$ref":"#/definitions/attributeString"},"fy":{"$ref":"#/definitions/attributeString"},"gradientTransform":{"$ref":"#/definitions/attributeString"},"gradientUnits":{"$ref":"#/definitions/attributeString"},"height":{"$ref":"#/definitions/attributeString"},"href":{"anyOf":[{"type":"string","pattern":"^#[a-zA-Z_][a-zA-Z0-9_.-]*$","maxLength":128},{"type":"string","pattern":"^data:image/(png|gif|jpeg|webp|avif);base64,[a-zA-Z0-9+/=]+$","maxLength":262144}]},"id":{"$ref":"#/definitions/attributeString"},"image-rendering":{"$ref":"#/definitions/attributeString"},"in":{"$ref":"#/definitions/attributeString"},"in2":{"$ref":"#/definitions/attributeString"},"intercept":{"$ref":"#/definitions/attributeString"},"k1":{"$ref":"#/definitions/attributeString"},"k2":{"$ref":"#/definitions/attributeString"},"k3":{"$ref":"#/definitions/attributeString"},"k4":{"$ref":"#/definitions/attributeString"},"kernelMatrix":{"$ref":"#/definitions/attributeString"},"kernelUnitLength":{"$ref":"#/definitions/attributeString"},"lang":{"$ref":"#/definitions/attributeString"},"lengthAdjust":{"$ref":"#/definitions/attributeString"},"letter-spacing":{"$ref":"#/definitions/attributeString"},"lighting-color":{"$ref":"#/definitions/colorValue"},"marker-end":{"$ref":"#/definitions/attributeString"},"marker-mid":{"$ref":"#/definitions/attributeString"},"marker-start":{"$ref":"#/definitions/attributeString"},"markerHeight":{"$ref":"#/definitions/attributeString"},"markerUnits":{"$ref":"#/definitions/attributeString"},"markerWidth":{"$ref":"#/definitions/attributeString"},"mask":{"$ref":"#/definitions/attributeString"},"maskContentUnits":{"$ref":"#/definitions/attributeString"},"maskUnits":{"$ref":"#/definitions/attributeString"},"media":{"$ref":"#/definitions/attributeString"},"method":{"$ref":"#/definitions/attributeString"},"mode":{"$ref":"#/definitions/attributeString"},"numOctaves":{"$ref":"#/definitions/attributeString"},"offset":{"$ref":"#/definitions/attributeString"},"opacity":{"$ref":"#/definitions/attributeString"},"operator":{"$ref":"#/definitions/attributeString"},"order":{"$ref":"#/definitions/attributeString"},"orient":{"$ref":"#/definitions/attributeString"},"overflow":{"$ref":"#/definitions/attributeString"},"paint-order":{"$ref":"#/definitions/attributeString"},"path":{"$ref":"#/definitions/attributeString"},"pathLength":{"$ref":"#/definitions/attributeString"},"patternContentUnits":{"$ref":"#/definitions/attributeString"},"patternTransform":{"$ref":"#/definitions/attributeString"},"patternUnits":{"$ref":"#/definitions/attributeString"},"points":{"$ref":"#/definitions/attributeString"},"preserveAlpha":{"$ref":"#/definitions/attributeString"},"preserveAspectRatio":{"$ref":"#/definitions/attributeString"},"primitiveUnits":{"$ref":"#/definitions/attributeString"},"r":{"$ref":"#/definitions/attributeString"},"radius":{"$ref":"#/definitions/attributeString"},"refX":{"$ref":"#/definitions/attributeString"},"refY":{"$ref":"#/definitions/attributeString"},"result":{"$ref":"#/definitions/attributeString"},"rx":{"$ref":"#/definitions/attributeString"},"ry":{"$ref":"#/definitions/attributeString"},"scale":{"$ref":"#/definitions/attributeString"},"seed":{"$ref":"#/definitions/attributeString"},"shape-rendering":{"$ref":"#/definitions/attributeString"},"slope":{"$ref":"#/definitions/attributeString"},"specularConstant":{"$ref":"#/definitions/attributeString"},"specularExponent":{"$ref":"#/definitions/attributeString"},"spreadMethod":{"$ref":"#/definitions/attributeString"},"startOffset":{"$ref":"#/definitions/attributeString"},"stdDeviation":{"$ref":"#/definitions/attributeString"},"stitchTiles":{"$ref":"#/definitions/attributeString"},"stop-color":{"$ref":"#/definitions/colorValue"},"stop-opacity":{"$ref":"#/definitions/attributeString"},"stroke":{"$ref":"#/definitions/colorValue"},"stroke-dasharray":{"$ref":"#/definitions/attributeString"},"stroke-dashoffset":{"$ref":"#/definitions/attributeString"},"stroke-linecap":{"$ref":"#/definitions/attributeString"},"stroke-linejoin":{"$ref":"#/definitions/attributeString"},"stroke-miterlimit":{"$ref":"#/definitions/attributeString"},"stroke-opacity":{"$ref":"#/definitions/attributeString"},"stroke-width":{"$ref":"#/definitions/attributeString"},"style":{"$ref":"#/definitions/cssString"},"surfaceScale":{"$ref":"#/definitions/attributeString"},"systemLanguage":{"$ref":"#/definitions/attributeString"},"tabindex":{"$ref":"#/definitions/attributeString"},"tableValues":{"$ref":"#/definitions/attributeString"},"targetX":{"$ref":"#/definitions/attributeString"},"targetY":{"$ref":"#/definitions/attributeString"},"text-anchor":{"$ref":"#/definitions/attributeString"},"text-decoration":{"$ref":"#/definitions/attributeString"},"text-rendering":{"$ref":"#/definitions/attributeString"},"textLength":{"$ref":"#/definitions/attributeString"},"transform":{"$ref":"#/definitions/attributeString"},"transform-origin":{"$ref":"#/definitions/attributeString"},"type":{"$ref":"#/definitions/attributeString"},"values":{"$ref":"#/definitions/attributeString"},"viewBox":{"$ref":"#/definitions/attributeString"},"visibility":{"$ref":"#/definitions/attributeString"},"width":{"$ref":"#/definitions/attributeString"},"word-spacing":{"$ref":"#/definitions/attributeString"},"writing-mode":{"$ref":"#/definitions/attributeString"},"x":{"$ref":"#/definitions/attributeString"},"x1":{"$ref":"#/definitions/attributeString"},"x2":{"$ref":"#/definitions/attributeString"},"xChannelSelector":{"$ref":"#/definitions/attributeString"},"y":{"$ref":"#/definitions/attributeString"},"y1":{"$ref":"#/definitions/attributeString"},"y2":{"$ref":"#/definitions/attributeString"},"yChannelSelector":{"$ref":"#/definitions/attributeString"},"z":{"$ref":"#/definitions/attributeString"}},"additionalProperties":false},"componentProbability":{"description":"The probability, expressed as a percentage, that this component is rendered at all.","type":"number","minimum":0,"maximum":100},"componentRotate":{"description":"A rotation in degrees. Defines a range the PRNG picks from. Set `min === max` for a fixed angle. A positive `step` quantizes the range to multiples of `step` starting at `min`; omit for a continuous range. When `(max - min)` is not a multiple of `step`, `max` itself is unreachable — the last bucket is clamped to `≤ max`.","type":"object","properties":{"min":{"type":"number","minimum":-360,"maximum":360},"max":{"type":"number","minimum":-360,"maximum":360},"step":{"type":"number","exclusiveMinimum":0,"maximum":720}},"required":["min","max"],"additionalProperties":false},"componentScale":{"description":"A scale factor around the component's own center (`1` corresponds to the original size). Defines a range the PRNG picks from. Set `min === max` for a fixed scale. A positive `step` quantizes the range to multiples of `step` starting at `min`; omit for a continuous range. When `(max - min)` is not a multiple of `step`, `max` itself is unreachable — the last bucket is clamped to `≤ max`.","type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":10},"max":{"type":"number","minimum":0,"maximum":10},"step":{"type":"number","exclusiveMinimum":0,"maximum":10}},"required":["min","max"],"additionalProperties":false},"componentTranslate":{"description":"A positional translation applied to the component after placement. Values are interpreted as a percentage of the component's size.","type":"object","properties":{"x":{"$ref":"#/definitions/translateValue"},"y":{"$ref":"#/definitions/translateValue"}},"additionalProperties":false},"componentBase":{"description":"A base component definition with its own dimensions and variants. The PRNG selects one variant per render based on the seed.","type":"object","properties":{"width":{"description":"The natural width of the component canvas in pixels.","type":"number","minimum":1,"maximum":1000000},"height":{"description":"The natural height of the component canvas in pixels.","type":"number","minimum":1,"maximum":1000000},"probability":{"$ref":"#/definitions/componentProbability"},"rotate":{"$ref":"#/definitions/componentRotate"},"scale":{"$ref":"#/definitions/componentScale"},"translate":{"$ref":"#/definitions/componentTranslate"},"variants":{"description":"The available visual variants of this component. The PRNG selects one variant per render. Keys must be `camelCaseName` identifiers.","type":"object","propertyNames":{"$ref":"#/definitions/camelCaseName"},"additionalProperties":{"type":"object","properties":{"elements":{"description":"The SVG elements that make up this variant.","type":"array","items":{"$ref":"#/definitions/element"},"maxItems":1024},"weight":{"description":"A weight that influences how likely the PRNG is to select this variant. Higher values make the variant more likely. When omitted, defaults to 1 (equal weighting). A value of 0 means the variant is not selected unless all available variants have a weight of 0.","type":"number","minimum":0,"maximum":1000000},"tags":{"description":"Optional tags for this variant (e.g. `hairLength:long`, `facialHair:beard`). The `tags` render option uses them to filter the variant pool.","type":"array","items":{"description":"A tag of the form `category` or `category:value`, where the category is an axis (e.g. `hairLength`, `mouthExpression`) and the value is its setting on that axis (e.g. `hairLength:long`). Each segment is camelCase.","type":"string","pattern":"^[a-z][a-zA-Z0-9]*(:[a-z][a-zA-Z0-9]*)?$","maxLength":129},"uniqueItems":true,"maxItems":32}},"required":["elements"],"additionalProperties":false},"maxProperties":512}},"required":["width","height","variants"],"additionalProperties":false},"componentAlias":{"description":"An alias that inherits its dimensions, variants, and transforms from another component referenced by `extends`. Aliases have no per-instance overrides — they are pure references.","type":"object","properties":{"extends":{"description":"The name of an existing, non-alias component in this `components` map.","$ref":"#/definitions/componentName"}},"required":["extends"],"additionalProperties":false}},"type":"object","properties":{"$id":{"type":"string","maxLength":256},"$schema":{"type":"string","maxLength":256},"$comment":{"type":"string","maxLength":4096},"meta":{"description":"Metadata about the avatar style, such as license information, creator details, and source references.","type":"object","properties":{"license":{"description":"License information for the avatar style.","type":"object","properties":{"name":{"description":"The name of the license, e.g. `CC BY 4.0`.","type":"string","maxLength":128},"url":{"description":"A link to the full license text.","$ref":"#/definitions/safeUrl"},"text":{"description":"The full license text.","type":"string","maxLength":32768}},"additionalProperties":false},"creator":{"description":"Information about the creator of the avatar style.","type":"object","properties":{"name":{"description":"The name of the creator.","type":"string","maxLength":128},"url":{"description":"A link to the creator's website or profile.","$ref":"#/definitions/safeUrl"}},"additionalProperties":false},"source":{"description":"Information about the original source of the artwork.","type":"object","properties":{"name":{"description":"The name of the original source.","type":"string","maxLength":128},"url":{"description":"A link to the original source.","$ref":"#/definitions/safeUrl"}},"additionalProperties":false}},"additionalProperties":false},"attributes":{"description":"Global SVG presentation attributes applied to the root `<svg>` element.","$ref":"#/definitions/attributes"},"canvas":{"description":"The main content of the avatar, defining the SVG structure, canvas dimensions, and element tree.","type":"object","properties":{"elements":{"description":"The list of SVG elements that make up the avatar.","type":"array","items":{"$ref":"#/definitions/element"},"maxItems":1024},"width":{"description":"The natural width of the avatar canvas in pixels.","type":"number","minimum":1,"maximum":1000000},"height":{"description":"The natural height of the avatar canvas in pixels.","type":"number","minimum":1,"maximum":1000000}},"required":["elements","width","height"],"additionalProperties":false},"components":{"description":"Named, reusable SVG components. Each component defines a set of variants that the PRNG can select from at render time, or aliases another component to render an additional, independently-randomized instance of it. Keys must be `camelCaseName` identifiers.","type":"object","propertyNames":{"$ref":"#/definitions/camelCaseName"},"additionalProperties":{"anyOf":[{"$ref":"#/definitions/componentBase"},{"$ref":"#/definitions/componentAlias"}]},"maxProperties":512},"colors":{"description":"Named color palettes used by the avatar. The PRNG selects colors from these groups at render time. Color groups can define constraints such as contrast or exclusion rules. Keys must be `camelCaseName` identifiers.","type":"object","propertyNames":{"$ref":"#/definitions/camelCaseName"},"additionalProperties":{"type":"object","properties":{"values":{"description":"The list of hex color values the PRNG can choose from.","type":"array","items":{"$ref":"#/definitions/hexColor"},"minItems":1,"maxItems":128},"notEqualTo":{"description":"A list of other color names. The selected color value must differ from the color values selected in those colors. The schema does not prevent cycles (e.g. `a` notEqualTo `b` and `b` notEqualTo `a`); renderers resolve palettes in definition order and must reject unsatisfiable configurations at load time.","type":"array","items":{"$ref":"#/definitions/colorName"},"maxItems":64},"contrastTo":{"description":"The name of another color. When specified, the PRNG is not used for selection — instead, the color value with the highest contrast against the selected color value of the referenced color is chosen. The schema does not prevent cycles (e.g. `a` contrastTo `b` and `b` contrastTo `a`); renderers resolve palettes in definition order and must reject unsatisfiable configurations at load time.","$ref":"#/definitions/colorName"}},"required":["values"],"additionalProperties":false},"maxProperties":512}},"required":["canvas"],"additionalProperties":false}
1
+ {"$id":"https://cdn.hopjs.net/npm/@dicebear/schema@1.6.0/dist/definition.min.json","$schema":"http://json-schema.org/draft-07/schema#","definitions":{"camelCaseName":{"description":"A camelCase identifier used for named things defined in the definition (colors, components, variants, animations). Must start with a lowercase letter and may contain letters and digits.","type":"string","pattern":"^[a-z][a-zA-Z0-9]*$","maxLength":64},"colorName":{"description":"A reference to a color palette defined in the top-level `colors` section.","allOf":[{"$ref":"#/definitions/camelCaseName"}]},"componentName":{"description":"A reference to a component defined in the top-level `components` section.","allOf":[{"$ref":"#/definitions/camelCaseName"}]},"translateValue":{"description":"A translation value expressed as a percentage of the component's width (for `x`) or height (for `y`). Defines a range the PRNG picks from. Set `min === max` for a fixed value. A positive `step` quantizes the range to multiples of `step` starting at `min`; omit for a continuous range. When `(max - min)` is not a multiple of `step`, `max` itself is unreachable — the last bucket is clamped to `≤ max`.","type":"object","properties":{"min":{"type":"number","minimum":-1000,"maximum":1000},"max":{"type":"number","minimum":-1000,"maximum":1000},"step":{"type":"number","exclusiveMinimum":0,"maximum":2000}},"required":["min","max"],"additionalProperties":false},"hexColor":{"description":"A hex color with leading `#`, in 3, 4, 6, or 8 digit form.","type":"string","pattern":"^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$","maxLength":9},"colorValue":{"description":"A color value for `fill`, `stroke`, `stop-color`, and other color attributes. Either a plain string (any CSS color format — named color, hex, `rgb()`, `oklch()`, `color-mix()`, local paint server reference `url(#id)`, etc.) or an object referencing a named color palette defined in the top-level `colors` section. CSS color syntax is not validated; invalid colors are the browser's problem.","anyOf":[{"$ref":"#/definitions/attributeString"},{"description":"A reference to a named color palette. At render time, the PRNG selects a color value from the referenced palette.","type":"object","properties":{"type":{"const":"color"},"name":{"description":"The name of the color palette to reference.","$ref":"#/definitions/colorName"}},"required":["type","name"],"additionalProperties":false}]},"safeUrl":{"description":"A URL restricted to HTTP and HTTPS protocols.","type":"string","pattern":"^https?://","maxLength":2048},"filteredString":{"description":"Base definition for the filtered-string family (`attributeString`, `cssString`). Blocks a shared set of known-dangerous patterns: external `url(...)` references (local `url(#id)` is allowed), `expression()`, `behavior:`, `-moz-binding`, `javascript:` / `vbscript:` URI schemes, and backslash escape sequences. This is not a general CSS sanitizer — it is a defense-in-depth injection filter, so substring matches of blocked tokens will reject otherwise-harmless strings (e.g. a plain text containing the literal word `javascript:`). The `maxLength` here acts as an absolute ceiling for all derivatives; callers narrow it further. The separator between a blocked token and what follows is written out as a literal character class rather than `\\s`. Two reasons. Every regex engine reads `\\s` differently, so the shorthand made the same definition valid in one language and invalid in another. And `\\s` covers code points no parser skips, such as U+00A0, which widened the filter without adding protection. The class holds the five characters a URL or CSS parser actually discards between a token and what follows. The same five appear negated in the `url` pattern, where they mark that the URL body has not started, which is how a local `url(#id)` is told apart from an external reference. Do not fold either back into `\\s`.","type":"string","maxLength":16384,"not":{"type":"string","anyOf":[{"type":"string","pattern":"[uU][rR][lL][ \\t\\n\\f\\r]*\\([ \\t\\n\\f\\r]*[^#) \\t\\n\\f\\r]"},{"type":"string","pattern":"[eE][xX][pP][rR][eE][sS][sS][iI][oO][nN][ \\t\\n\\f\\r]*\\("},{"type":"string","pattern":"[bB][eE][hH][aA][vV][iI][oO][rR][ \\t\\n\\f\\r]*:"},{"type":"string","pattern":"-[mM][oO][zZ]-[bB][iI][nN][dD][iI][nN][gG]"},{"type":"string","pattern":"[jJ][aA][vV][aA][sS][cC][rR][iI][pP][tT][ \\t\\n\\f\\r]*:"},{"type":"string","pattern":"[vV][bB][sS][cC][rR][iI][pP][tT][ \\t\\n\\f\\r]*:"},{"type":"string","pattern":"\\\\"}]}},"attributeString":{"description":"The default value type for generic SVG attribute values — transform lists, numeric values, keywords, and so on. No syntactic validation; only the common `filteredString` injection filter applies.","type":"string","allOf":[{"$ref":"#/definitions/filteredString"}],"maxLength":1024},"pathDataString":{"description":"Used for the `d` attribute of `<path>`. Same filter as `attributeString`, but with a much larger length budget to accommodate complex path geometry.","type":"string","allOf":[{"$ref":"#/definitions/filteredString"}],"maxLength":16384},"cssString":{"description":"Used for inline `style` attribute content and `<style>` element bodies. Known-dangerous `@`-rules — `@import`, `@font-face`, `@document`, `@charset` — are rejected in addition to the common `filteredString` injection filter. Other `@`-rules (`@media`, `@keyframes`, `@supports`, `@layer`, etc.) are permitted, but the `filteredString` injection filter still applies to their contents — so external `url(...)` references inside e.g. an `@media` rule are still blocked. This is not a general CSS sanitizer.","type":"string","allOf":[{"$ref":"#/definitions/filteredString"}],"maxLength":4096,"not":{"type":"string","anyOf":[{"type":"string","pattern":"@[iI][mM][pP][oO][rR][tT]"},{"type":"string","pattern":"@[fF][oO][nN][tT]-[fF][aA][cC][eE]"},{"type":"string","pattern":"@[dD][oO][cC][uU][mM][eE][nN][tT]"},{"type":"string","pattern":"@[cC][hH][aA][rR][sS][eE][tT]"}]}},"element":{"description":"An SVG node. One of four mutually exclusive forms, discriminated by `type` (and `name` for the `<style>` special case): a text element, a component reference, a `<style>` element, or any other SVG element.","anyOf":[{"$ref":"#/definitions/textElement"},{"$ref":"#/definitions/componentReference"},{"$ref":"#/definitions/styleElement"},{"$ref":"#/definitions/genericElement"}]},"textElement":{"description":"A raw text node. Its `value` becomes the text content rendered into the parent element.","type":"object","properties":{"type":{"const":"text"},"value":{"description":"Either a plain string, or a `variable` reference resolved at render time to the seed's initials.","anyOf":[{"type":"string","maxLength":4096},{"type":"object","properties":{"type":{"const":"variable"},"name":{"enum":["initial","initials"]}},"required":["type","name"],"additionalProperties":false}]}},"required":["type","value"],"additionalProperties":false},"componentReference":{"description":"A reference to a named component defined in the top-level `components` section. At render time, the PRNG selects one of the component's variants. Optional `attributes` are applied to the generated `<use>` tag — most commonly a `transform` placing the instance, but any allowlisted attribute is accepted.","type":"object","properties":{"type":{"const":"component"},"name":{"$ref":"#/definitions/componentName"},"attributes":{"$ref":"#/definitions/attributes"},"animations":{"$ref":"#/definitions/animations"}},"required":["type","name"],"additionalProperties":false},"styleElement":{"description":"An SVG `<style>` element. Its CSS content must be provided as `text` children; each child's value is validated as a CSS string with a stricter content policy than generic SVG attribute values.","type":"object","properties":{"type":{"const":"element"},"name":{"const":"style"},"attributes":{"$ref":"#/definitions/attributes"},"children":{"type":"array","items":{"type":"object","properties":{"type":{"const":"text"},"value":{"$ref":"#/definitions/cssString"}},"required":["type","value"],"additionalProperties":false},"maxItems":64}},"required":["type","name"],"additionalProperties":false},"genericElement":{"description":"Any SVG element other than `<style>`, which has its own stricter content policy.","type":"object","properties":{"type":{"const":"element"},"name":{"description":"The SVG tag name. Only a safe subset of SVG elements is permitted; dangerous elements such as `script`, `foreignObject`, or `a` are excluded.","enum":["circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","title","tspan","use","view"]},"attributes":{"$ref":"#/definitions/attributes"},"animations":{"$ref":"#/definitions/animations"},"children":{"type":"array","items":{"$ref":"#/definitions/element"},"maxItems":1024}},"required":["type","name"],"additionalProperties":false},"attributes":{"description":"A map of allowed SVG presentation attributes. Only a safe subset is permitted; event handlers (e.g. `onclick`) and namespace attributes (e.g. `xlink:href`) are not allowed.","type":"object","properties":{"alignment-baseline":{"$ref":"#/definitions/attributeString"},"amplitude":{"$ref":"#/definitions/attributeString"},"azimuth":{"$ref":"#/definitions/attributeString"},"baseFrequency":{"$ref":"#/definitions/attributeString"},"baseline-shift":{"$ref":"#/definitions/attributeString"},"bias":{"$ref":"#/definitions/attributeString"},"class":{"$ref":"#/definitions/attributeString"},"clipPathUnits":{"$ref":"#/definitions/attributeString"},"clip-path":{"$ref":"#/definitions/attributeString"},"clip-rule":{"$ref":"#/definitions/attributeString"},"color":{"$ref":"#/definitions/colorValue"},"color-interpolation":{"$ref":"#/definitions/attributeString"},"color-interpolation-filters":{"$ref":"#/definitions/attributeString"},"crossorigin":{"$ref":"#/definitions/attributeString"},"cx":{"$ref":"#/definitions/attributeString"},"cy":{"$ref":"#/definitions/attributeString"},"d":{"$ref":"#/definitions/pathDataString"},"decoding":{"$ref":"#/definitions/attributeString"},"diffuseConstant":{"$ref":"#/definitions/attributeString"},"direction":{"$ref":"#/definitions/attributeString"},"display":{"$ref":"#/definitions/attributeString"},"divisor":{"$ref":"#/definitions/attributeString"},"dominant-baseline":{"$ref":"#/definitions/attributeString"},"dx":{"$ref":"#/definitions/attributeString"},"dy":{"$ref":"#/definitions/attributeString"},"edgeMode":{"$ref":"#/definitions/attributeString"},"elevation":{"$ref":"#/definitions/attributeString"},"exponent":{"$ref":"#/definitions/attributeString"},"fill":{"$ref":"#/definitions/colorValue"},"fill-opacity":{"$ref":"#/definitions/attributeString"},"fill-rule":{"$ref":"#/definitions/attributeString"},"filter":{"$ref":"#/definitions/attributeString"},"filterUnits":{"$ref":"#/definitions/attributeString"},"flood-color":{"$ref":"#/definitions/colorValue"},"flood-opacity":{"$ref":"#/definitions/attributeString"},"font-family":{"anyOf":[{"$ref":"#/definitions/attributeString"},{"type":"object","properties":{"type":{"const":"variable"},"name":{"const":"fontFamily"}},"required":["type","name"],"additionalProperties":false}]},"font-size":{"$ref":"#/definitions/attributeString"},"font-size-adjust":{"$ref":"#/definitions/attributeString"},"font-style":{"$ref":"#/definitions/attributeString"},"font-variant":{"$ref":"#/definitions/attributeString"},"font-weight":{"anyOf":[{"$ref":"#/definitions/attributeString"},{"type":"object","properties":{"type":{"const":"variable"},"name":{"const":"fontWeight"}},"required":["type","name"],"additionalProperties":false}]},"fx":{"$ref":"#/definitions/attributeString"},"fy":{"$ref":"#/definitions/attributeString"},"gradientTransform":{"$ref":"#/definitions/attributeString"},"gradientUnits":{"$ref":"#/definitions/attributeString"},"height":{"$ref":"#/definitions/attributeString"},"href":{"anyOf":[{"type":"string","pattern":"^#[a-zA-Z_][a-zA-Z0-9_.-]*$","maxLength":128},{"type":"string","pattern":"^data:image/(png|gif|jpeg|webp|avif);base64,[a-zA-Z0-9+/=]+$","maxLength":262144}]},"id":{"$ref":"#/definitions/attributeString"},"image-rendering":{"$ref":"#/definitions/attributeString"},"in":{"$ref":"#/definitions/attributeString"},"in2":{"$ref":"#/definitions/attributeString"},"intercept":{"$ref":"#/definitions/attributeString"},"k1":{"$ref":"#/definitions/attributeString"},"k2":{"$ref":"#/definitions/attributeString"},"k3":{"$ref":"#/definitions/attributeString"},"k4":{"$ref":"#/definitions/attributeString"},"kernelMatrix":{"$ref":"#/definitions/attributeString"},"kernelUnitLength":{"$ref":"#/definitions/attributeString"},"lang":{"$ref":"#/definitions/attributeString"},"lengthAdjust":{"$ref":"#/definitions/attributeString"},"letter-spacing":{"$ref":"#/definitions/attributeString"},"lighting-color":{"$ref":"#/definitions/colorValue"},"marker-end":{"$ref":"#/definitions/attributeString"},"marker-mid":{"$ref":"#/definitions/attributeString"},"marker-start":{"$ref":"#/definitions/attributeString"},"markerHeight":{"$ref":"#/definitions/attributeString"},"markerUnits":{"$ref":"#/definitions/attributeString"},"markerWidth":{"$ref":"#/definitions/attributeString"},"mask":{"$ref":"#/definitions/attributeString"},"maskContentUnits":{"$ref":"#/definitions/attributeString"},"maskUnits":{"$ref":"#/definitions/attributeString"},"media":{"$ref":"#/definitions/attributeString"},"method":{"$ref":"#/definitions/attributeString"},"mode":{"$ref":"#/definitions/attributeString"},"numOctaves":{"$ref":"#/definitions/attributeString"},"offset":{"$ref":"#/definitions/attributeString"},"opacity":{"$ref":"#/definitions/attributeString"},"operator":{"$ref":"#/definitions/attributeString"},"order":{"$ref":"#/definitions/attributeString"},"orient":{"$ref":"#/definitions/attributeString"},"overflow":{"$ref":"#/definitions/attributeString"},"paint-order":{"$ref":"#/definitions/attributeString"},"path":{"$ref":"#/definitions/attributeString"},"pathLength":{"$ref":"#/definitions/attributeString"},"patternContentUnits":{"$ref":"#/definitions/attributeString"},"patternTransform":{"$ref":"#/definitions/attributeString"},"patternUnits":{"$ref":"#/definitions/attributeString"},"points":{"$ref":"#/definitions/attributeString"},"preserveAlpha":{"$ref":"#/definitions/attributeString"},"preserveAspectRatio":{"$ref":"#/definitions/attributeString"},"primitiveUnits":{"$ref":"#/definitions/attributeString"},"r":{"$ref":"#/definitions/attributeString"},"radius":{"$ref":"#/definitions/attributeString"},"refX":{"$ref":"#/definitions/attributeString"},"refY":{"$ref":"#/definitions/attributeString"},"result":{"$ref":"#/definitions/attributeString"},"rx":{"$ref":"#/definitions/attributeString"},"ry":{"$ref":"#/definitions/attributeString"},"scale":{"$ref":"#/definitions/attributeString"},"seed":{"$ref":"#/definitions/attributeString"},"shape-rendering":{"$ref":"#/definitions/attributeString"},"slope":{"$ref":"#/definitions/attributeString"},"specularConstant":{"$ref":"#/definitions/attributeString"},"specularExponent":{"$ref":"#/definitions/attributeString"},"spreadMethod":{"$ref":"#/definitions/attributeString"},"startOffset":{"$ref":"#/definitions/attributeString"},"stdDeviation":{"$ref":"#/definitions/attributeString"},"stitchTiles":{"$ref":"#/definitions/attributeString"},"stop-color":{"$ref":"#/definitions/colorValue"},"stop-opacity":{"$ref":"#/definitions/attributeString"},"stroke":{"$ref":"#/definitions/colorValue"},"stroke-dasharray":{"$ref":"#/definitions/attributeString"},"stroke-dashoffset":{"$ref":"#/definitions/attributeString"},"stroke-linecap":{"$ref":"#/definitions/attributeString"},"stroke-linejoin":{"$ref":"#/definitions/attributeString"},"stroke-miterlimit":{"$ref":"#/definitions/attributeString"},"stroke-opacity":{"$ref":"#/definitions/attributeString"},"stroke-width":{"$ref":"#/definitions/attributeString"},"style":{"$ref":"#/definitions/cssString"},"surfaceScale":{"$ref":"#/definitions/attributeString"},"systemLanguage":{"$ref":"#/definitions/attributeString"},"tabindex":{"$ref":"#/definitions/attributeString"},"tableValues":{"$ref":"#/definitions/attributeString"},"targetX":{"$ref":"#/definitions/attributeString"},"targetY":{"$ref":"#/definitions/attributeString"},"text-anchor":{"$ref":"#/definitions/attributeString"},"text-decoration":{"$ref":"#/definitions/attributeString"},"text-rendering":{"$ref":"#/definitions/attributeString"},"textLength":{"$ref":"#/definitions/attributeString"},"transform":{"$ref":"#/definitions/attributeString"},"transform-origin":{"$ref":"#/definitions/attributeString"},"type":{"$ref":"#/definitions/attributeString"},"values":{"$ref":"#/definitions/attributeString"},"viewBox":{"$ref":"#/definitions/attributeString"},"visibility":{"$ref":"#/definitions/attributeString"},"width":{"$ref":"#/definitions/attributeString"},"word-spacing":{"$ref":"#/definitions/attributeString"},"writing-mode":{"$ref":"#/definitions/attributeString"},"x":{"$ref":"#/definitions/attributeString"},"x1":{"$ref":"#/definitions/attributeString"},"x2":{"$ref":"#/definitions/attributeString"},"xChannelSelector":{"$ref":"#/definitions/attributeString"},"y":{"$ref":"#/definitions/attributeString"},"y1":{"$ref":"#/definitions/attributeString"},"y2":{"$ref":"#/definitions/attributeString"},"yChannelSelector":{"$ref":"#/definitions/attributeString"},"z":{"$ref":"#/definitions/attributeString"}},"additionalProperties":false},"componentProbability":{"description":"The probability, expressed as a percentage, that this component is rendered at all.","type":"number","minimum":0,"maximum":100},"componentRotate":{"description":"A rotation in degrees. Defines a range the PRNG picks from. Set `min === max` for a fixed angle. A positive `step` quantizes the range to multiples of `step` starting at `min`; omit for a continuous range. When `(max - min)` is not a multiple of `step`, `max` itself is unreachable — the last bucket is clamped to `≤ max`.","type":"object","properties":{"min":{"type":"number","minimum":-360,"maximum":360},"max":{"type":"number","minimum":-360,"maximum":360},"step":{"type":"number","exclusiveMinimum":0,"maximum":720}},"required":["min","max"],"additionalProperties":false},"componentScale":{"description":"A scale factor around the component's own center (`1` corresponds to the original size). Defines a range the PRNG picks from. Set `min === max` for a fixed scale. A positive `step` quantizes the range to multiples of `step` starting at `min`; omit for a continuous range. When `(max - min)` is not a multiple of `step`, `max` itself is unreachable — the last bucket is clamped to `≤ max`.","type":"object","properties":{"min":{"type":"number","minimum":0,"maximum":10},"max":{"type":"number","minimum":0,"maximum":10},"step":{"type":"number","exclusiveMinimum":0,"maximum":10}},"required":["min","max"],"additionalProperties":false},"componentTranslate":{"description":"A positional translation applied to the component after placement. Values are interpreted as a percentage of the component's size.","type":"object","properties":{"x":{"$ref":"#/definitions/translateValue"},"y":{"$ref":"#/definitions/translateValue"}},"additionalProperties":false},"componentBase":{"description":"A base component definition with its own dimensions and variants. The PRNG selects one variant per render based on the seed.","type":"object","properties":{"width":{"description":"The natural width of the component canvas in pixels.","type":"number","minimum":1,"maximum":1000000},"height":{"description":"The natural height of the component canvas in pixels.","type":"number","minimum":1,"maximum":1000000},"probability":{"$ref":"#/definitions/componentProbability"},"rotate":{"$ref":"#/definitions/componentRotate"},"scale":{"$ref":"#/definitions/componentScale"},"translate":{"$ref":"#/definitions/componentTranslate"},"variants":{"description":"The available visual variants of this component. The PRNG selects one variant per render. Keys must be `camelCaseName` identifiers.","type":"object","propertyNames":{"$ref":"#/definitions/camelCaseName"},"additionalProperties":{"type":"object","properties":{"elements":{"description":"The SVG elements that make up this variant.","type":"array","items":{"$ref":"#/definitions/element"},"maxItems":1024},"weight":{"description":"A weight that influences how likely the PRNG is to select this variant. Higher values make the variant more likely. When omitted, defaults to 1 (equal weighting). A value of 0 means the variant is not selected unless all available variants have a weight of 0.","type":"number","minimum":0,"maximum":1000000},"tags":{"description":"Optional tags for this variant (e.g. `hairLength:long`, `facialHair:beard`). The `tags` render option uses them to filter the variant pool.","type":"array","items":{"description":"A tag of the form `category` or `category:value`, where the category is an axis (e.g. `hairLength`, `mouthExpression`) and the value is its setting on that axis (e.g. `hairLength:long`). Each segment is camelCase.","type":"string","pattern":"^[a-z][a-zA-Z0-9]*(:[a-z][a-zA-Z0-9]*)?$","maxLength":129},"uniqueItems":true,"maxItems":32}},"required":["elements"],"additionalProperties":false},"maxProperties":512}},"required":["width","height","variants"],"additionalProperties":false},"componentAlias":{"description":"An alias that inherits its dimensions, variants, and transforms from another component referenced by `extends`. Aliases have no per-instance overrides — they are pure references.","type":"object","properties":{"extends":{"description":"The name of an existing, non-alias component in this `components` map.","$ref":"#/definitions/componentName"}},"required":["extends"],"additionalProperties":false},"easingValue":{"description":"An easing for the transition between two keyframes. Either a named CSS easing keyword (`hold` renders as `step-end`) or a cubic bezier given by its two control points. `x1` and `x2` must stay within 0..1, while `y1` and `y2` may leave that range for overshoot curves.","anyOf":[{"enum":["linear","ease","easeIn","easeOut","easeInOut","hold"]},{"type":"object","properties":{"x1":{"type":"number","minimum":0,"maximum":1},"y1":{"type":"number","minimum":-4,"maximum":4},"x2":{"type":"number","minimum":0,"maximum":1},"y2":{"type":"number","minimum":-4,"maximum":4}},"required":["x1","y1","x2","y2"],"additionalProperties":false}]},"animationKeyframe":{"description":"A single keyframe. `at` positions it on the timeline as a percentage of the animation's duration. `easing` shapes the segment from this keyframe to the next one and falls back to the animation's default easing when omitted. Keyframes must be listed in strictly ascending `at` order, so no two of them share a position. The schema cannot express that constraint, renderers reject violations at load time. An instant jump is written with the `hold` easing instead of a duplicate position.","type":"object","properties":{"at":{"type":"number","minimum":0,"maximum":100},"value":{"type":"number","minimum":-36000,"maximum":36000},"easing":{"$ref":"#/definitions/easingValue"}},"required":["at","value"],"additionalProperties":false},"animationTrack":{"description":"The keyframes animating one property of the element.","type":"object","properties":{"keyframes":{"type":"array","items":{"$ref":"#/definitions/animationKeyframe"},"minItems":1,"maxItems":64}},"required":["keyframes"],"additionalProperties":false},"animation":{"description":"One animation timeline for an element, made of per-property keyframe tracks. Renderers translate it to CSS when the `animation` render option is enabled; without the option the output stays static. Defaults applied by renderers, not by this schema: `delay` 0, `iterations` `infinite`, `direction` `normal`, `fill` `none`, `easing` `linear`, `origin` center. When a track's first keyframe sits after 0% or its last before 100%, renderers pad the endpoints with copies of the nearest keyframe, so the resting value holds outside the keyframed span.","type":"object","properties":{"name":{"description":"An optional name that groups this timeline under a user-selectable animation. The `animation` render option accepts these names to play a subset of a style's animations. Several timelines may share one name and are then switched together. A timeline without a name only plays when the option enables all animations.","allOf":[{"$ref":"#/definitions/camelCaseName"}]},"duration":{"description":"The duration of one iteration in seconds.","type":"number","exclusiveMinimum":0,"maximum":3600},"delay":{"description":"Start delay in seconds. Negative values shift the phase, the animation starts mid-cycle.","type":"number","minimum":-3600,"maximum":3600},"iterations":{"description":"How often the animation runs. Defaults to `infinite`.","anyOf":[{"const":"infinite"},{"type":"number","exclusiveMinimum":0,"maximum":10000}]},"direction":{"description":"The playback direction per iteration, matching the CSS `animation-direction` keywords.","enum":["normal","reverse","alternate","alternateReverse"]},"fill":{"description":"Whether the last keyframe's value persists after a finite run, matching CSS `animation-fill-mode`.","enum":["none","forwards"]},"easing":{"description":"The default easing for segments whose keyframes define none.","allOf":[{"$ref":"#/definitions/easingValue"}]},"origin":{"description":"The transform origin for `rotate` and `scale` tracks, as a percentage of the element's bounding box (`fill-box`). Defaults to the center (`x` 50, `y` 50).","type":"object","properties":{"x":{"type":"number","minimum":-1000,"maximum":1000},"y":{"type":"number","minimum":-1000,"maximum":1000}},"required":["x","y"],"additionalProperties":false},"tracks":{"description":"The animated properties. Tracks compose in a fixed order: translation applies outside rotation, rotation outside scale, opacity innermost.","type":"object","properties":{"translateX":{"description":"Horizontal offset in user units, relative to the element's resting position. Positive values move right.","allOf":[{"$ref":"#/definitions/animationTrack"}]},"translateY":{"description":"Vertical offset in user units, relative to the element's resting position. Positive values move down.","allOf":[{"$ref":"#/definitions/animationTrack"}]},"rotate":{"description":"Rotation in degrees around `origin`, added to the element's resting transform. Positive values rotate clockwise. Values are not normalized, `360` describes one full turn.","allOf":[{"$ref":"#/definitions/animationTrack"}]},"scaleX":{"description":"Horizontal scale factor around `origin`. `1` is the resting size.","allOf":[{"$ref":"#/definitions/animationTrack"}]},"scaleY":{"description":"Vertical scale factor around `origin`. `1` is the resting size.","allOf":[{"$ref":"#/definitions/animationTrack"}]},"opacity":{"description":"Opacity from 0 to 1, multiplied with the element's own `opacity` attribute.","allOf":[{"$ref":"#/definitions/animationTrack"}]}},"minProperties":1,"additionalProperties":false}},"required":["duration","tracks"],"additionalProperties":false},"animations":{"description":"Animation timelines attached to an element. Each entry is an independent timeline with its own duration, delay, and tracks.","type":"array","items":{"$ref":"#/definitions/animation"},"minItems":1,"maxItems":8}},"type":"object","properties":{"$id":{"type":"string","maxLength":256},"$schema":{"type":"string","maxLength":256},"$comment":{"type":"string","maxLength":4096},"meta":{"description":"Metadata about the avatar style, such as license information, creator details, and source references.","type":"object","properties":{"license":{"description":"License information for the avatar style.","type":"object","properties":{"name":{"description":"The name of the license, e.g. `CC BY 4.0`.","type":"string","maxLength":128},"url":{"description":"A link to the full license text.","$ref":"#/definitions/safeUrl"},"text":{"description":"The full license text.","type":"string","maxLength":32768}},"additionalProperties":false},"creator":{"description":"Information about the creator of the avatar style.","type":"object","properties":{"name":{"description":"The name of the creator.","type":"string","maxLength":128},"url":{"description":"A link to the creator's website or profile.","$ref":"#/definitions/safeUrl"}},"additionalProperties":false},"source":{"description":"Information about the original source of the artwork.","type":"object","properties":{"name":{"description":"The name of the original source.","type":"string","maxLength":128},"url":{"description":"A link to the original source.","$ref":"#/definitions/safeUrl"}},"additionalProperties":false}},"additionalProperties":false},"attributes":{"description":"Global SVG presentation attributes applied to the root `<svg>` element.","$ref":"#/definitions/attributes"},"canvas":{"description":"The main content of the avatar, defining the SVG structure, canvas dimensions, and element tree.","type":"object","properties":{"elements":{"description":"The list of SVG elements that make up the avatar.","type":"array","items":{"$ref":"#/definitions/element"},"maxItems":1024},"width":{"description":"The natural width of the avatar canvas in pixels.","type":"number","minimum":1,"maximum":1000000},"height":{"description":"The natural height of the avatar canvas in pixels.","type":"number","minimum":1,"maximum":1000000}},"required":["elements","width","height"],"additionalProperties":false},"components":{"description":"Named, reusable SVG components. Each component defines a set of variants that the PRNG can select from at render time, or aliases another component to render an additional, independently-randomized instance of it. Keys must be `camelCaseName` identifiers.","type":"object","propertyNames":{"$ref":"#/definitions/camelCaseName"},"additionalProperties":{"anyOf":[{"$ref":"#/definitions/componentBase"},{"$ref":"#/definitions/componentAlias"}]},"maxProperties":512},"colors":{"description":"Named color palettes used by the avatar. The PRNG selects colors from these groups at render time. Color groups can define constraints such as contrast or exclusion rules. Keys must be `camelCaseName` identifiers.","type":"object","propertyNames":{"$ref":"#/definitions/camelCaseName"},"additionalProperties":{"type":"object","properties":{"values":{"description":"The list of hex color values the PRNG can choose from.","type":"array","items":{"$ref":"#/definitions/hexColor"},"minItems":1,"maxItems":128},"notEqualTo":{"description":"A list of other color names. The selected color value must differ from the color values selected in those colors. The schema does not prevent cycles (e.g. `a` notEqualTo `b` and `b` notEqualTo `a`); renderers resolve palettes in definition order and must reject unsatisfiable configurations at load time.","type":"array","items":{"$ref":"#/definitions/colorName"},"maxItems":64},"contrastTo":{"description":"The name of another color. When specified, the PRNG is not used for selection — instead, the color value with the highest contrast against the selected color value of the referenced color is chosen. The schema does not prevent cycles (e.g. `a` contrastTo `b` and `b` contrastTo `a`); renderers resolve palettes in definition order and must reject unsatisfiable configurations at load time.","$ref":"#/definitions/colorName"}},"required":["values"],"additionalProperties":false},"maxProperties":512}},"required":["canvas"],"additionalProperties":false}
@@ -1 +1 @@
1
- {"$id":"https://cdn.hopjs.net/npm/@dicebear/schema@1.5.1/dist/options.min.json","$schema":"http://json-schema.org/draft-07/schema#","title":"DiceBear options schema","type":"object","definitions":{"flip":{"type":"string","enum":["none","horizontal","vertical","both"]},"rotate":{"type":"number","minimum":-360,"maximum":360},"scale":{"type":"number","minimum":0,"maximum":10},"translate":{"type":"number","minimum":-1000,"maximum":1000},"borderRadius":{"type":"number","minimum":0,"maximum":50},"color":{"type":"string","pattern":"^#?([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"},"colorFill":{"type":"string","enum":["solid","linear","radial"]},"colorFillStops":{"type":"integer","minimum":2},"fontFamilyName":{"type":"string","pattern":"^[a-zA-Z0-9_\\-]+( [a-zA-Z0-9_\\-]+)*(, ?[a-zA-Z0-9_\\-]+( [a-zA-Z0-9_\\-]+)*)*$","maxLength":256},"fontWeight":{"type":"integer","minimum":1,"maximum":1000},"variantName":{"type":"string","pattern":"^[a-z][a-zA-Z0-9]*$","maxLength":64},"tagFilter":{"type":"string","pattern":"^!?[a-z][a-zA-Z0-9]*(:[a-z][a-zA-Z0-9]*)?$","maxLength":130},"rotateOption":{"anyOf":[{"$ref":"#/definitions/rotate"},{"type":"array","items":{"$ref":"#/definitions/rotate"},"minItems":0,"maxItems":2}]},"translateOption":{"anyOf":[{"$ref":"#/definitions/translate"},{"type":"array","items":{"$ref":"#/definitions/translate"},"minItems":0,"maxItems":2}]},"scaleOption":{"anyOf":[{"$ref":"#/definitions/scale"},{"type":"array","items":{"$ref":"#/definitions/scale"},"minItems":0,"maxItems":2}]}},"properties":{"seed":{"type":"string","description":"The starting value for the pseudorandom number generator (PRNG) used in the avatar generation process. This option is essential for creating unique and consistent avatars. By setting a specific seed, you ensure that the same sequence of random characteristics is applied, allowing identical avatars to be reproduced. This is especially valuable for maintaining consistency across sessions and allowing users to share or recreate their personalized avatars.","maxLength":1024},"size":{"type":"integer","description":"Specifies the dimensions of the avatar in pixels. If no size is specified, the avatar defaults to a responsive design or scales to 100% of its container. This flexibility allows the avatar to seamlessly adapt to different screen sizes and layouts, ensuring optimal display across devices and environments.","minimum":1,"maximum":4096},"idRandomization":{"type":"boolean","description":"Generates random values for all IDs present in the SVG. This process ensures that while the avatar appears visually identical, the underlying code remains unique. This is particularly useful for embedding the same avatar multiple times in a document without running into duplicate ID conflicts that can interfere with styles and scripts."},"title":{"type":"string","description":"Specifies an accessible title for the avatar. When set, the SVG will include a <title> element and an aria-label attribute, allowing screen readers and other assistive technologies to describe the avatar to users.","maxLength":256},"flip":{"description":"Specifies how the avatar will be flipped. Options include `none` for no flip, `horizontal` for a left-to-right flip, `vertical` for an upside-down flip, and `both` for a complete flip. If specified as an array, the PRNG will choose from the available options.","anyOf":[{"$ref":"#/definitions/flip"},{"type":"array","items":{"$ref":"#/definitions/flip"},"minItems":0,"maxItems":4}]},"fontFamily":{"description":"Specifies the font family used for text rendering. If specified as an array, the PRNG will choose from the available options.","anyOf":[{"$ref":"#/definitions/fontFamilyName"},{"type":"array","items":{"$ref":"#/definitions/fontFamilyName"},"minItems":0,"maxItems":128}]},"fontWeight":{"description":"Specifies the font weight used for text rendering. The value must be an integer between 1 and 1000. If specified as an array, the PRNG will choose from the available options.","anyOf":[{"$ref":"#/definitions/fontWeight"},{"type":"array","items":{"$ref":"#/definitions/fontWeight"},"minItems":0,"maxItems":128}]},"scale":{"description":"Sets the scaling of the avatar. A value of `1` corresponds to the original size of the avatar. This setting affects the size of the avatar itself, but not the size of the avatar container; any excess content will be clipped. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.","allOf":[{"$ref":"#/definitions/scaleOption"}]},"borderRadius":{"description":"This is the radius of the corners of the avatar. This value can be a float or an integer. A value of 0 means that the avatar has sharp corners, while larger values result in more rounded corners. The maximum value is 50, which turns the avatar into a complete circle. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.","anyOf":[{"$ref":"#/definitions/borderRadius"},{"type":"array","items":{"$ref":"#/definitions/borderRadius"},"minItems":0,"maxItems":2}]},"tags":{"description":"Uses tags to filter which variants of the avatar's components the PRNG may select. Each token is `category` or `category:value` (e.g. `hairLength:long`), optionally prefixed with `!` to exclude. An include affects only its own category: it drops variants that carry a different value in that category and keeps variants that carry no tag there. A bare `category` include requires the category: it drops variants that carry no tag there, but only in components where the category is in use (e.g. `animation` turns on a style's opt-in animation). An exclude removes variants carrying the named tag. Unknown tags are ignored. A `*Variant` option for the same component takes precedence: when set, it determines that component's variants and the tag filter does not apply to it. Can be a single string or an array of strings.","anyOf":[{"$ref":"#/definitions/tagFilter"},{"type":"array","items":{"$ref":"#/definitions/tagFilter"},"minItems":0,"maxItems":128}]}},"patternProperties":{"^[a-z][a-zA-Z0-9]*Probability$":{"type":"number","description":"Represents the probability that a component of the avatar will be displayed. The value can be either a float or an integer, but is interpreted as a percentage. For example, a value of 0 means the part will never be displayed, while a value of 100 means it will always be displayed.","minimum":0,"maximum":100},"^[a-z][a-zA-Z0-9]*Variant$":{"description":"Specifies which variants of the avatar part can be selected by the PRNG and their relative weights. A string or array of strings filters which variants the PRNG can choose from. An object maps variant names to non-negative weights, simultaneously filtering and weighting selection. Variant names must be camelCase identifiers.","anyOf":[{"$ref":"#/definitions/variantName"},{"type":"array","items":{"$ref":"#/definitions/variantName"},"minItems":0,"maxItems":128},{"type":"object","propertyNames":{"$ref":"#/definitions/variantName"},"additionalProperties":{"type":"number","minimum":0},"minProperties":1,"maxProperties":512}]},"^[a-z][a-zA-Z0-9]*Color$":{"description":"Specifies which colors for the avatar component can be selected by the PRNG. If specified as a string or array with only one value, the value is fixed. However, if specified as an array with multiple values, the PRNG will choose from the available options. The color must be specified as a hex value.","anyOf":[{"$ref":"#/definitions/color"},{"type":"array","items":{"$ref":"#/definitions/color"},"minItems":0,"maxItems":128}]},"^[a-z][a-zA-Z0-9]*ColorFill$":{"description":"Specifies the color fill method for the avatar component. Options include `solid` for a flat color, `linear` for a linear gradient, and `radial` for a radial gradient. If specified as a string or array with only one value, the value is fixed. However, if specified as an array with multiple values, the PRNG will choose from the available options.","anyOf":[{"$ref":"#/definitions/colorFill"},{"type":"array","items":{"$ref":"#/definitions/colorFill"},"minItems":0,"maxItems":128}]},"^[a-z][a-zA-Z0-9]*ColorFillStops$":{"description":"Specifies the number of color stops for gradient fills. This value is only relevant when the color fill method is set to `linear` or `radial`. The minimum value is 2. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.","anyOf":[{"$ref":"#/definitions/colorFillStops"},{"type":"array","items":{"$ref":"#/definitions/colorFillStops"},"minItems":0,"maxItems":2}]},"^[a-z][a-zA-Z0-9]*ColorAngle$":{"description":"Specifies the angle for the color gradient. This value can be an integer or a float. A value of 0 results in no rotation, while values between -360 and 360 define the degree of rotation. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.","allOf":[{"$ref":"#/definitions/rotateOption"}]},"^[a-z][a-zA-Z0-9]*ColorOrder$":{"description":"Specifies whether the PRNG may rearrange the colors specified in the `*Color` option. With `random`, the default, the colors are shuffled before use, so which colors appear and in which order depends on the seed. With `fixed`, the colors are used in exactly the specified order: gradient fills apply them as color stops from first to last, and solid fills always use the first color. With `fixed` and no `*ColorFillStops` value, the number of gradient stops defaults to the number of specified colors instead of 2. Without a `*Color` option, `fixed` only skips the shuffle: the style's default palette is deduplicated and used in sorted order. Constraints in the style definition, such as a contrast sort against another color group, still apply and can vary with the seed.","type":"string","enum":["random","fixed"]},"^rotate$":{"description":"This is the rotation angle for the entire avatar. This value can be an integer or a float. A value of 0 results in no rotation, while values between -360 and 360 define the degree of rotation in both directions. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.","allOf":[{"$ref":"#/definitions/rotateOption"}]},"^translateY$":{"description":"This is the vertical translation of the entire avatar. This value can be an integer or a float. A value of 0 results in no translation, while positive values move the avatar down and negative values move it up. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.","allOf":[{"$ref":"#/definitions/translateOption"}]},"^translateX$":{"description":"This is the horizontal translation of the entire avatar. This value can be an integer or a float. A value of 0 results in no translation, while positive values move the avatar to the right and negative values move it to the left. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.","allOf":[{"$ref":"#/definitions/translateOption"}]}},"propertyNames":{"maxLength":128},"additionalProperties":false,"maxProperties":512}
1
+ {"$id":"https://cdn.hopjs.net/npm/@dicebear/schema@1.6.0/dist/options.min.json","$schema":"http://json-schema.org/draft-07/schema#","title":"DiceBear options schema","type":"object","definitions":{"flip":{"type":"string","enum":["none","horizontal","vertical","both"]},"rotate":{"type":"number","minimum":-360,"maximum":360},"scale":{"type":"number","minimum":0,"maximum":10},"translate":{"type":"number","minimum":-1000,"maximum":1000},"borderRadius":{"type":"number","minimum":0,"maximum":50},"color":{"type":"string","pattern":"^#?([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$"},"colorFill":{"type":"string","enum":["solid","linear","radial"]},"colorFillStops":{"type":"integer","minimum":2},"fontFamilyName":{"type":"string","pattern":"^[a-zA-Z0-9_\\-]+( [a-zA-Z0-9_\\-]+)*(, ?[a-zA-Z0-9_\\-]+( [a-zA-Z0-9_\\-]+)*)*$","maxLength":256},"fontWeight":{"type":"integer","minimum":1,"maximum":1000},"variantName":{"type":"string","pattern":"^[a-z][a-zA-Z0-9]*$","maxLength":64},"tagFilter":{"type":"string","pattern":"^!?[a-z][a-zA-Z0-9]*(:[a-z][a-zA-Z0-9]*)?$","maxLength":130},"animationSpeed":{"type":"number","minimum":0.1,"maximum":10},"animationName":{"description":"The name of an animation defined by the style, matching the `name` of one or more animation timelines in its definition.","type":"string","pattern":"^[a-z][a-zA-Z0-9]*$","maxLength":64},"rotateOption":{"anyOf":[{"$ref":"#/definitions/rotate"},{"type":"array","items":{"$ref":"#/definitions/rotate"},"minItems":0,"maxItems":2}]},"translateOption":{"anyOf":[{"$ref":"#/definitions/translate"},{"type":"array","items":{"$ref":"#/definitions/translate"},"minItems":0,"maxItems":2}]},"scaleOption":{"anyOf":[{"$ref":"#/definitions/scale"},{"type":"array","items":{"$ref":"#/definitions/scale"},"minItems":0,"maxItems":2}]}},"properties":{"seed":{"type":"string","description":"The starting value for the pseudorandom number generator (PRNG) used in the avatar generation process. This option is essential for creating unique and consistent avatars. By setting a specific seed, you ensure that the same sequence of random characteristics is applied, allowing identical avatars to be reproduced. This is especially valuable for maintaining consistency across sessions and allowing users to share or recreate their personalized avatars.","maxLength":1024},"size":{"type":"integer","description":"Specifies the dimensions of the avatar in pixels. If no size is specified, the avatar defaults to a responsive design or scales to 100% of its container. This flexibility allows the avatar to seamlessly adapt to different screen sizes and layouts, ensuring optimal display across devices and environments.","minimum":1,"maximum":4096},"idRandomization":{"type":"boolean","description":"Generates random values for all IDs present in the SVG. This process ensures that while the avatar appears visually identical, the underlying code remains unique. This is particularly useful for embedding the same avatar multiple times in a document without running into duplicate ID conflicts that can interfere with styles and scripts."},"title":{"type":"string","description":"Specifies an accessible title for the avatar. When set, the SVG will include a <title> element and an aria-label attribute, allowing screen readers and other assistive technologies to describe the avatar to users.","maxLength":256},"flip":{"description":"Specifies how the avatar will be flipped. Options include `none` for no flip, `horizontal` for a left-to-right flip, `vertical` for an upside-down flip, and `both` for a complete flip. If specified as an array, the PRNG will choose from the available options.","anyOf":[{"$ref":"#/definitions/flip"},{"type":"array","items":{"$ref":"#/definitions/flip"},"minItems":0,"maxItems":4}]},"fontFamily":{"description":"Specifies the font family used for text rendering. If specified as an array, the PRNG will choose from the available options.","anyOf":[{"$ref":"#/definitions/fontFamilyName"},{"type":"array","items":{"$ref":"#/definitions/fontFamilyName"},"minItems":0,"maxItems":128}]},"fontWeight":{"description":"Specifies the font weight used for text rendering. The value must be an integer between 1 and 1000. If specified as an array, the PRNG will choose from the available options.","anyOf":[{"$ref":"#/definitions/fontWeight"},{"type":"array","items":{"$ref":"#/definitions/fontWeight"},"minItems":0,"maxItems":128}]},"scale":{"description":"Sets the scaling of the avatar. A value of `1` corresponds to the original size of the avatar. This setting affects the size of the avatar itself, but not the size of the avatar container; any excess content will be clipped. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.","allOf":[{"$ref":"#/definitions/scaleOption"}]},"borderRadius":{"description":"This is the radius of the corners of the avatar. This value can be a float or an integer. A value of 0 means that the avatar has sharp corners, while larger values result in more rounded corners. The maximum value is 50, which turns the avatar into a complete circle. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.","anyOf":[{"$ref":"#/definitions/borderRadius"},{"type":"array","items":{"$ref":"#/definitions/borderRadius"},"minItems":0,"maxItems":2}]},"tags":{"description":"Uses tags to filter which variants of the avatar's components the PRNG may select. Each token is `category` or `category:value` (e.g. `hairLength:long`), optionally prefixed with `!` to exclude. An include affects only its own category: it drops variants that carry a different value in that category and keeps variants that carry no tag there. A bare `category` include requires the category: it drops variants that carry no tag there, but only in components where the category is in use (e.g. `facialHair` keeps only the variants that show facial hair). An exclude removes variants carrying the named tag. Unknown tags are ignored. A `*Variant` option for the same component takes precedence: when set, it determines that component's variants and the tag filter does not apply to it. Can be a single string or an array of strings.","anyOf":[{"$ref":"#/definitions/tagFilter"},{"type":"array","items":{"$ref":"#/definitions/tagFilter"},"minItems":0,"maxItems":128}]},"animation":{"description":"Enables the style's declarative animations. `true` plays all of them, a name or list of names plays only the timelines carrying those names, and timelines without a name stay static in that case. An empty list plays nothing, same as false. Defaults to false, so the SVG output and every raster conversion stay static and deterministic. Styles without declarative animations ignore this option, and unknown names match nothing.","anyOf":[{"type":"boolean"},{"$ref":"#/definitions/animationName"},{"type":"array","items":{"$ref":"#/definitions/animationName"},"minItems":0,"maxItems":32}]},"animationSpeed":{"description":"A playback speed multiplier for declarative animations. A value of 2 plays animations twice as fast, 0.5 at half speed. Durations and delays are divided by this value. Only meaningful when `animation` is enabled. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.","anyOf":[{"$ref":"#/definitions/animationSpeed"},{"type":"array","items":{"$ref":"#/definitions/animationSpeed"},"minItems":0,"maxItems":2}]}},"patternProperties":{"^[a-z][a-zA-Z0-9]*Probability$":{"type":"number","description":"Represents the probability that a component of the avatar will be displayed. The value can be either a float or an integer, but is interpreted as a percentage. For example, a value of 0 means the part will never be displayed, while a value of 100 means it will always be displayed.","minimum":0,"maximum":100},"^[a-z][a-zA-Z0-9]*Variant$":{"description":"Specifies which variants of the avatar part can be selected by the PRNG and their relative weights. A string or array of strings filters which variants the PRNG can choose from. An object maps variant names to non-negative weights, simultaneously filtering and weighting selection. Variant names must be camelCase identifiers.","anyOf":[{"$ref":"#/definitions/variantName"},{"type":"array","items":{"$ref":"#/definitions/variantName"},"minItems":0,"maxItems":128},{"type":"object","propertyNames":{"$ref":"#/definitions/variantName"},"additionalProperties":{"type":"number","minimum":0},"minProperties":1,"maxProperties":512}]},"^[a-z][a-zA-Z0-9]*Color$":{"description":"Specifies which colors for the avatar component can be selected by the PRNG. If specified as a string or array with only one value, the value is fixed. However, if specified as an array with multiple values, the PRNG will choose from the available options. The color must be specified as a hex value.","anyOf":[{"$ref":"#/definitions/color"},{"type":"array","items":{"$ref":"#/definitions/color"},"minItems":0,"maxItems":128}]},"^[a-z][a-zA-Z0-9]*ColorFill$":{"description":"Specifies the color fill method for the avatar component. Options include `solid` for a flat color, `linear` for a linear gradient, and `radial` for a radial gradient. If specified as a string or array with only one value, the value is fixed. However, if specified as an array with multiple values, the PRNG will choose from the available options.","anyOf":[{"$ref":"#/definitions/colorFill"},{"type":"array","items":{"$ref":"#/definitions/colorFill"},"minItems":0,"maxItems":128}]},"^[a-z][a-zA-Z0-9]*ColorFillStops$":{"description":"Specifies the number of color stops for gradient fills. This value is only relevant when the color fill method is set to `linear` or `radial`. The minimum value is 2. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.","anyOf":[{"$ref":"#/definitions/colorFillStops"},{"type":"array","items":{"$ref":"#/definitions/colorFillStops"},"minItems":0,"maxItems":2}]},"^[a-z][a-zA-Z0-9]*ColorAngle$":{"description":"Specifies the angle for the color gradient. This value can be an integer or a float. A value of 0 results in no rotation, while values between -360 and 360 define the degree of rotation. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.","allOf":[{"$ref":"#/definitions/rotateOption"}]},"^[a-z][a-zA-Z0-9]*ColorOrder$":{"description":"Specifies whether the PRNG may rearrange the colors specified in the `*Color` option. With `random`, the default, the colors are shuffled before use, so which colors appear and in which order depends on the seed. With `fixed`, the colors are used in exactly the specified order: gradient fills apply them as color stops from first to last, and solid fills always use the first color. With `fixed` and no `*ColorFillStops` value, the number of gradient stops defaults to the number of specified colors instead of 2. Without a `*Color` option, `fixed` only skips the shuffle: the style's default palette is deduplicated and used in sorted order. Constraints in the style definition, such as a contrast sort against another color group, still apply and can vary with the seed.","type":"string","enum":["random","fixed"]},"^rotate$":{"description":"This is the rotation angle for the entire avatar. This value can be an integer or a float. A value of 0 results in no rotation, while values between -360 and 360 define the degree of rotation in both directions. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.","allOf":[{"$ref":"#/definitions/rotateOption"}]},"^translateY$":{"description":"This is the vertical translation of the entire avatar. This value can be an integer or a float. A value of 0 results in no translation, while positive values move the avatar down and negative values move it up. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.","allOf":[{"$ref":"#/definitions/translateOption"}]},"^translateX$":{"description":"This is the horizontal translation of the entire avatar. This value can be an integer or a float. A value of 0 results in no translation, while positive values move the avatar to the right and negative values move it to the left. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.","allOf":[{"$ref":"#/definitions/translateOption"}]}},"propertyNames":{"maxLength":128},"additionalProperties":false,"maxProperties":512}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dicebear/schema",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
4
4
  "description": "JSON Schema definitions for DiceBear avatar styles and options",
5
5
  "keywords": [
6
6
  "dicebear",
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "definitions": {
4
4
  "camelCaseName": {
5
- "description": "A camelCase identifier used for named things defined in the definition (colors, components, variants). Must start with a lowercase letter and may contain letters and digits.",
5
+ "description": "A camelCase identifier used for named things defined in the definition (colors, components, variants, animations). Must start with a lowercase letter and may contain letters and digits.",
6
6
  "type": "string",
7
7
  "pattern": "^[a-z][a-zA-Z0-9]*$",
8
8
  "maxLength": 64
@@ -164,7 +164,10 @@
164
164
  "properties": {
165
165
  "type": { "const": "component" },
166
166
  "name": { "$ref": "#/definitions/componentName" },
167
- "attributes": { "$ref": "#/definitions/attributes" }
167
+ "attributes": { "$ref": "#/definitions/attributes" },
168
+ "animations": {
169
+ "$ref": "#/definitions/animations"
170
+ }
168
171
  },
169
172
  "required": ["type", "name"],
170
173
  "additionalProperties": false
@@ -259,6 +262,9 @@
259
262
  ]
260
263
  },
261
264
  "attributes": { "$ref": "#/definitions/attributes" },
265
+ "animations": {
266
+ "$ref": "#/definitions/animations"
267
+ },
262
268
  "children": {
263
269
  "type": "array",
264
270
  "items": { "$ref": "#/definitions/element" },
@@ -580,6 +586,190 @@
580
586
  },
581
587
  "required": ["extends"],
582
588
  "additionalProperties": false
589
+ },
590
+ "easingValue": {
591
+ "description": "An easing for the transition between two keyframes. Either a named CSS easing keyword (`hold` renders as `step-end`) or a cubic bezier given by its two control points. `x1` and `x2` must stay within 0..1, while `y1` and `y2` may leave that range for overshoot curves.",
592
+ "anyOf": [
593
+ {
594
+ "enum": ["linear", "ease", "easeIn", "easeOut", "easeInOut", "hold"]
595
+ },
596
+ {
597
+ "type": "object",
598
+ "properties": {
599
+ "x1": {
600
+ "type": "number",
601
+ "minimum": 0,
602
+ "maximum": 1
603
+ },
604
+ "y1": {
605
+ "type": "number",
606
+ "minimum": -4,
607
+ "maximum": 4
608
+ },
609
+ "x2": {
610
+ "type": "number",
611
+ "minimum": 0,
612
+ "maximum": 1
613
+ },
614
+ "y2": {
615
+ "type": "number",
616
+ "minimum": -4,
617
+ "maximum": 4
618
+ }
619
+ },
620
+ "required": ["x1", "y1", "x2", "y2"],
621
+ "additionalProperties": false
622
+ }
623
+ ]
624
+ },
625
+ "animationKeyframe": {
626
+ "description": "A single keyframe. `at` positions it on the timeline as a percentage of the animation's duration. `easing` shapes the segment from this keyframe to the next one and falls back to the animation's default easing when omitted. Keyframes must be listed in strictly ascending `at` order, so no two of them share a position. The schema cannot express that constraint, renderers reject violations at load time. An instant jump is written with the `hold` easing instead of a duplicate position.",
627
+ "type": "object",
628
+ "properties": {
629
+ "at": {
630
+ "type": "number",
631
+ "minimum": 0,
632
+ "maximum": 100
633
+ },
634
+ "value": {
635
+ "type": "number",
636
+ "minimum": -36000,
637
+ "maximum": 36000
638
+ },
639
+ "easing": {
640
+ "$ref": "#/definitions/easingValue"
641
+ }
642
+ },
643
+ "required": ["at", "value"],
644
+ "additionalProperties": false
645
+ },
646
+ "animationTrack": {
647
+ "description": "The keyframes animating one property of the element.",
648
+ "type": "object",
649
+ "properties": {
650
+ "keyframes": {
651
+ "type": "array",
652
+ "items": {
653
+ "$ref": "#/definitions/animationKeyframe"
654
+ },
655
+ "minItems": 1,
656
+ "maxItems": 64
657
+ }
658
+ },
659
+ "required": ["keyframes"],
660
+ "additionalProperties": false
661
+ },
662
+ "animation": {
663
+ "description": "One animation timeline for an element, made of per-property keyframe tracks. Renderers translate it to CSS when the `animation` render option is enabled; without the option the output stays static. Defaults applied by renderers, not by this schema: `delay` 0, `iterations` `infinite`, `direction` `normal`, `fill` `none`, `easing` `linear`, `origin` center. When a track's first keyframe sits after 0% or its last before 100%, renderers pad the endpoints with copies of the nearest keyframe, so the resting value holds outside the keyframed span.",
664
+ "type": "object",
665
+ "properties": {
666
+ "name": {
667
+ "description": "An optional name that groups this timeline under a user-selectable animation. The `animation` render option accepts these names to play a subset of a style's animations. Several timelines may share one name and are then switched together. A timeline without a name only plays when the option enables all animations.",
668
+ "allOf": [
669
+ {
670
+ "$ref": "#/definitions/camelCaseName"
671
+ }
672
+ ]
673
+ },
674
+ "duration": {
675
+ "description": "The duration of one iteration in seconds.",
676
+ "type": "number",
677
+ "exclusiveMinimum": 0,
678
+ "maximum": 3600
679
+ },
680
+ "delay": {
681
+ "description": "Start delay in seconds. Negative values shift the phase, the animation starts mid-cycle.",
682
+ "type": "number",
683
+ "minimum": -3600,
684
+ "maximum": 3600
685
+ },
686
+ "iterations": {
687
+ "description": "How often the animation runs. Defaults to `infinite`.",
688
+ "anyOf": [
689
+ {
690
+ "const": "infinite"
691
+ },
692
+ {
693
+ "type": "number",
694
+ "exclusiveMinimum": 0,
695
+ "maximum": 10000
696
+ }
697
+ ]
698
+ },
699
+ "direction": {
700
+ "description": "The playback direction per iteration, matching the CSS `animation-direction` keywords.",
701
+ "enum": ["normal", "reverse", "alternate", "alternateReverse"]
702
+ },
703
+ "fill": {
704
+ "description": "Whether the last keyframe's value persists after a finite run, matching CSS `animation-fill-mode`.",
705
+ "enum": ["none", "forwards"]
706
+ },
707
+ "easing": {
708
+ "description": "The default easing for segments whose keyframes define none.",
709
+ "allOf": [{ "$ref": "#/definitions/easingValue" }]
710
+ },
711
+ "origin": {
712
+ "description": "The transform origin for `rotate` and `scale` tracks, as a percentage of the element's bounding box (`fill-box`). Defaults to the center (`x` 50, `y` 50).",
713
+ "type": "object",
714
+ "properties": {
715
+ "x": {
716
+ "type": "number",
717
+ "minimum": -1000,
718
+ "maximum": 1000
719
+ },
720
+ "y": {
721
+ "type": "number",
722
+ "minimum": -1000,
723
+ "maximum": 1000
724
+ }
725
+ },
726
+ "required": ["x", "y"],
727
+ "additionalProperties": false
728
+ },
729
+ "tracks": {
730
+ "description": "The animated properties. Tracks compose in a fixed order: translation applies outside rotation, rotation outside scale, opacity innermost.",
731
+ "type": "object",
732
+ "properties": {
733
+ "translateX": {
734
+ "description": "Horizontal offset in user units, relative to the element's resting position. Positive values move right.",
735
+ "allOf": [{ "$ref": "#/definitions/animationTrack" }]
736
+ },
737
+ "translateY": {
738
+ "description": "Vertical offset in user units, relative to the element's resting position. Positive values move down.",
739
+ "allOf": [{ "$ref": "#/definitions/animationTrack" }]
740
+ },
741
+ "rotate": {
742
+ "description": "Rotation in degrees around `origin`, added to the element's resting transform. Positive values rotate clockwise. Values are not normalized, `360` describes one full turn.",
743
+ "allOf": [{ "$ref": "#/definitions/animationTrack" }]
744
+ },
745
+ "scaleX": {
746
+ "description": "Horizontal scale factor around `origin`. `1` is the resting size.",
747
+ "allOf": [{ "$ref": "#/definitions/animationTrack" }]
748
+ },
749
+ "scaleY": {
750
+ "description": "Vertical scale factor around `origin`. `1` is the resting size.",
751
+ "allOf": [{ "$ref": "#/definitions/animationTrack" }]
752
+ },
753
+ "opacity": {
754
+ "description": "Opacity from 0 to 1, multiplied with the element's own `opacity` attribute.",
755
+ "allOf": [{ "$ref": "#/definitions/animationTrack" }]
756
+ }
757
+ },
758
+ "minProperties": 1,
759
+ "additionalProperties": false
760
+ }
761
+ },
762
+ "required": ["duration", "tracks"],
763
+ "additionalProperties": false
764
+ },
765
+ "animations": {
766
+ "description": "Animation timelines attached to an element. Each entry is an independent timeline with its own duration, delay, and tracks.",
767
+ "type": "array",
768
+ "items": {
769
+ "$ref": "#/definitions/animation"
770
+ },
771
+ "minItems": 1,
772
+ "maxItems": 8
583
773
  }
584
774
  },
585
775
  "type": "object",
package/src/options.json CHANGED
@@ -59,6 +59,13 @@
59
59
  "pattern": "^!?[a-z][a-zA-Z0-9]*(:[a-z][a-zA-Z0-9]*)?$",
60
60
  "maxLength": 130
61
61
  },
62
+ "animationSpeed": { "type": "number", "minimum": 0.1, "maximum": 10 },
63
+ "animationName": {
64
+ "description": "The name of an animation defined by the style, matching the `name` of one or more animation timelines in its definition.",
65
+ "type": "string",
66
+ "pattern": "^[a-z][a-zA-Z0-9]*$",
67
+ "maxLength": 64
68
+ },
62
69
  "rotateOption": {
63
70
  "anyOf": [
64
71
  { "$ref": "#/definitions/rotate" },
@@ -183,7 +190,7 @@
183
190
  ]
184
191
  },
185
192
  "tags": {
186
- "description": "Uses tags to filter which variants of the avatar's components the PRNG may select. Each token is `category` or `category:value` (e.g. `hairLength:long`), optionally prefixed with `!` to exclude. An include affects only its own category: it drops variants that carry a different value in that category and keeps variants that carry no tag there. A bare `category` include requires the category: it drops variants that carry no tag there, but only in components where the category is in use (e.g. `animation` turns on a style's opt-in animation). An exclude removes variants carrying the named tag. Unknown tags are ignored. A `*Variant` option for the same component takes precedence: when set, it determines that component's variants and the tag filter does not apply to it. Can be a single string or an array of strings.",
193
+ "description": "Uses tags to filter which variants of the avatar's components the PRNG may select. Each token is `category` or `category:value` (e.g. `hairLength:long`), optionally prefixed with `!` to exclude. An include affects only its own category: it drops variants that carry a different value in that category and keeps variants that carry no tag there. A bare `category` include requires the category: it drops variants that carry no tag there, but only in components where the category is in use (e.g. `facialHair` keeps only the variants that show facial hair). An exclude removes variants carrying the named tag. Unknown tags are ignored. A `*Variant` option for the same component takes precedence: when set, it determines that component's variants and the tag filter does not apply to it. Can be a single string or an array of strings.",
187
194
  "anyOf": [
188
195
  {
189
196
  "$ref": "#/definitions/tagFilter"
@@ -197,6 +204,31 @@
197
204
  "maxItems": 128
198
205
  }
199
206
  ]
207
+ },
208
+ "animation": {
209
+ "description": "Enables the style's declarative animations. `true` plays all of them, a name or list of names plays only the timelines carrying those names, and timelines without a name stay static in that case. An empty list plays nothing, same as false. Defaults to false, so the SVG output and every raster conversion stay static and deterministic. Styles without declarative animations ignore this option, and unknown names match nothing.",
210
+ "anyOf": [
211
+ { "type": "boolean" },
212
+ { "$ref": "#/definitions/animationName" },
213
+ {
214
+ "type": "array",
215
+ "items": { "$ref": "#/definitions/animationName" },
216
+ "minItems": 0,
217
+ "maxItems": 32
218
+ }
219
+ ]
220
+ },
221
+ "animationSpeed": {
222
+ "description": "A playback speed multiplier for declarative animations. A value of 2 plays animations twice as fast, 0.5 at half speed. Durations and delays are divided by this value. Only meaningful when `animation` is enabled. If specified as an array, the PRNG will select a value within the specified range, including the values themselves.",
223
+ "anyOf": [
224
+ { "$ref": "#/definitions/animationSpeed" },
225
+ {
226
+ "type": "array",
227
+ "items": { "$ref": "#/definitions/animationSpeed" },
228
+ "minItems": 0,
229
+ "maxItems": 2
230
+ }
231
+ ]
200
232
  }
201
233
  },
202
234
  "patternProperties": {