This Sprite Collection combines the Sprite Collections male and female and selects the gender randomly.
Usage
HTTP-API (recommended)
Our free HTTP-API is the easiest way to use this sprite collection. Just use the following URL as image source.
https://avatars.dicebear.com/v2/human/:seed.svg
The value of :seed
can be anything you like - but don't use any sensitive or personal data here! The GET parameter
options
can be used to pass options.
Examples
NPM
Install the Avatars and this sprite collection with the following command.
npm install --save @dicebear/avatars @dicebear/avatars-male-sprites @dicebear/avatars-female-sprites @dicebear/avatars-human-sprites
Now you are ready to create your first Avatar.
import Avatars from '@dicebear/avatars';
import sprites from '@dicebear/avatars-human-sprites';
let options = {};
let avatars = new Avatars(sprites(options));
let svg = avatars.create('custom-seed');
Options
name | type | default | description |
---|
mood | array of strings | ['happy', 'sad', 'surprised'] | Possible values: sad , happy , surprised |
Further information
You can find the DiceBear Avatars documentation at avatars.dicebear.com