DiceBear 10.0 - Release Notes #527
FlorianKoerner
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This release is a big one, and it’s been in development for years. I’m sure I’ve overlooked a few things in this changelog, so please bear with me! 😅
My goal has always been to separate avatar styles more clearly from the code to prevent license confusion. At the same time, I've always wanted to define avatar styles using JSON so that they can be reused in any programming language. That is exactly what we are implementing with this release.
6 new avatar styles!
Before we get into the technical details, here's something to feast your eyes on. The following avatar styles are new:
Disco
Disco by DiceBear, licensed under CC0 1.0.
Glyphs
This avatar style is a remix of: Abstract Avatars for All Creative Profile Use by Matt Houser, licensed under CC BY 4.0.
Initial Face
Initial Face by DiceBear, licensed under CC0 1.0.
Shape Grid
Shape Grid by DiceBear, licensed under CC0 1.0.
Stripes
Stripes by DiceBear, licensed under CC0 1.0.
Triangles
Triangles by DiceBear, licensed under CC0 1.0.
🧑🎨 Style Definitions
Each avatar style is now stored in a JSON file rather than as JavaScript code. This clearly separates the code, which is under the MIT license, from the license for the avatar style. Consequently, there is no need to reimplement an avatar style for DiceBear in other languages.
The definition schema is implemented as a JSON schema, which is described in more detail in the following documentation:
🧑💻 PHP Support
In addition to JavaScript, we now also support PHP! The output is identical to that of the JavaScript library when the same avatar style and options are used. We’re not stopping there, though - we have plans for further implementations in Python, Rust, Go and many more languages.
Example
🛝 Better Playground
The playground has also been completely redesigned. You can now:
📖 Better Documentation
The documentation has been reorganized. In particular, the avatar style documentation is now much clearer and displays all component variants and colors with a better preview than before.
💻 Updated CLI
You can now use your own avatar styles with the CLI.
dicebear ./path/to/your/avatar-style.json --seed test --format svg🆕 Updated JavaScript API
All individual avatar style packages (e.g.
@dicebear/initials,@dicebear/adventurer, etc.) and the@dicebear/collectionpackage have been removed.Avatar styles are now distributed as JSON definition files via the separate
dicebear/stylesrepository and installed through the@dicebear/stylespackage. The format follows the new DiceBear Avatar Style JSON Schema.Before:
After:
🧐 Integrated Validation
Built-in validation is now available for avatar styles and options. You will now be notified right away if you use them incorrectly.
⚖️ Weighted Variants Support
You can now assign weights to component variants. For instance, you can make certain components, such as a particular hat, appear either rarely or frequently. The choice is yours.
🌈 Gradient support
You can now set any color as a gradient. This gives you even more scope for creativity and allows you to achieve vibrant, bold results.
👀 Changed options
The option values may have changed. For the most accurate information, check the avatar styles documentation directly or use the Playground.
Now, component variants are always suffixed with
Variant.Before:
{ "eyes": ["blink"] }Now:
{ "eyesVariant": ["blink"] }🛠️ New tools
There are two new tools available on the website:
WCAG Contrast Picker
See which of two contrast colors DiceBear picks for any color - using the exact WCAG 2.1 algorithm from
@dicebear/core.Bundle Size Estimator
Pick the styles you plan to use and see how many gzipped kilobytes they'll add to your JavaScript bundle.
☑️ Updated API, Exporter Plugin for Figma
Of course, these tools have also been updated so you can get started right away with version 10.
This discussion was created from the release DiceBear 10.0 - Release Notes.
Beta Was this translation helpful? Give feedback.
All reactions