npm @dicebear/avatars 4.6.0
[4.6.0] - 2021-04-18

latest releases: 4.10.8, 4.10.7, 4.10.6...
3 years ago

Added

  • New API based on functions instead of classes in preparation for version 5.0

    Old API

    import Avatars from `@dicebear/avatars`;
    import style from `@dicebear/avatars-identicon-sprites`;
    
    let options = {};
    let seed = 'custom-seed';
    let avatars = new Avatars(style, options);
    let svg = avatars.create(seed);

    New API

    import { createAvatar } from `@dicebear/avatars`;
    import * as style from `@dicebear/avatars-identicon-sprites`;
    
    let svg = createAvatar(style, {
      seed: 'custom-seed',
      // ... and other options
    });
  • JSON Schema added to each avatar style. Used for API, Types and upcoming features.

  • Metadata in generated avatars with author and license information.

@dicebear/avatars

  • New Option backgroundColor

@dicebear/micah

@dicebear/avatars-avataaars-sprites

  • New option values for accessoriesColor, clotheColor and hatColor:

    • blue01
    • blue02
    • blue03
    • gray01
    • gray02
    • pastelBlue
    • pastelGreen
    • pastelOrange
    • pastelRed
    • pastelYellow
  • New option clotheGraphic

  • New option values for clothes:

    • blazerAndShirt
    • blazerAndSweater
    • collarAndSweater
    • graphicShirt
    • shirtCrewNeck
    • shirtScoopNeck
    • shirtVNeck
  • New option values for eyebrows:

    • angryNatural
    • defaultNatural
    • flatNatural
    • raisedExcited
    • raisedExcitedNatural
    • sadConcerned
    • sadConcernedNatural
    • unibrowNatural
    • upDown
    • upDownNatural
    • frownNatural
  • New option values for eyes:

    • closed
    • xDizzy
    • eyeRoll
  • New option values for facialHairColor and hairColor:

    • blondeGolden
    • brownDark
    • pastelPink
    • silverGray
  • New option values for facialHair:

    • beardMedium
    • beardLight
    • beardMagestic
    • moustaceFancy
    • moustacheMagnum
  • New option values for mouth:

    • screamOpen
  • New option values for top:

    • bigHair
    • bob
    • bun
    • curly
    • curvy
    • dreads
    • frida
    • fro
    • froAndBand
    • miaWallace
    • longButNotTooLong
    • shavedSides
    • straight01
    • straight02
    • straightAndStrand
    • dreads01
    • dreads02
    • frizzle
    • shaggy
    • shaggyMullet
    • shortCurly
    • shortFlat
    • shortRound
    • shortWaved
    • sides
    • theCaesar
    • theCaesarAndSidePart
    • hat
    • winterHat01
    • winterHat02
    • winterHat03
    • winterHat04

Changed

  • Dependency svgson updated to version 5.2
  • Removed style isolation:isolate in all avatar styles

Deprecated

  • Default exports are deprecated. Use new function based API instead. (See "Added")

@dicebear/avatars

  • Color class is deprecated and will be removed with version 5.0.
  • Parser class is deprecated and will be removed with version 5.0.
  • Option background is deprecated. Use backgroundColor instead.

@dicebear/avatars-avataaars-sprites

  • Some accessoriesColor and clotheColor values are deprecated:

    • blue => use blue01, blue02 and blue03 instead
    • gray => use gray01 and gray02 instead
    • pastel => use pastelBlue, pastelGreen, pastelOrange, pastelRed and pastelYellow instead
  • Some clothes values are deprecated:

    • blazer => use blazerAndShirt and blazerAndSweater instead
    • sweater => use collarAndSweater instead
    • shirt => use graphicShirt, shirtCrewNeck, shirtScoopNeck and shirtVNeck instead
  • Some eyebrow values are deprecated:

    • flat => use flatNatural instead
    • raised => use raisedExcited and raisedExcitedNatural instead
    • sad => use sadConcerned and sadConcernedNatural instead
    • unibrow => use unibrowNatural instead
    • up => use upDown and upDownNatural instead
    • frown => use frownNatural instead
  • Some eyes values are deprecated:

    • close => use closed instead
    • dizzy => use xDizzy instead
    • roll => use eyeRoll instead
  • Some facialHairColor and hairColor values are deprecated:

    • pastel => use pastelPink instead
    • gray => use silverGray instead
  • Some facialHair values are deprecated:

    • medium => use beardMedium instead
    • light => use beardLight instead
    • majestic => use beardMajestic instead
    • fancy => use moustaceFancy instead
    • magnum => use moustacheMagnum instead
  • Some mouth values are deprecated:

    • scream => use screamOpen instead
  • Option mode is deprecated.

  • Some top values are deprecated:

    • longHair => use bigHair, bob, bun, curly, curvy, dreads, frida, fro, froAndBand, miaWallace,
      longButNotTooLong, shavedSides, straight01, straight02 and straightAndStrand instead
    • shortHair => use
      dreads01,dreads02,frizzle,shaggy,shaggyMullet,shortCurly,shortFlat,shortRound,shortWaved,sides,theCaesar
      and theCaesarAndSidePart instead

@dicebear/avatars-gridy-sprites

  • Change deterministic default to true.

Removed

@dicebear/avatars

  • Removed unused webpack build. We will completely switch to microbundle with version 5 and also support CDNs like
    unpkg.

Don't miss a new avatars release

NewReleases is sending notifications on new releases.