Identicon

Inspired by donpark/identicon

Usage#

HTTP-API (recommended)#

Our free HTTP-API is the easiest way to use this avatar style. Just use the following URL as image source.

https://avatars.dicebear.com/api/identicon/:seed.svg

See the HTTP API documentation for more information.

Examples#

previewurl
https://avatars.dicebear.com/api/identicon/example.svg
https://avatars.dicebear.com/api/identicon/example.svg?padding=0.4&background=%23f0f0f0

NPM#

Install the Avatars and this avatar style with the following command.

npm install --save @dicebear/avatars @dicebear/avatars-identicon-sprites

Now you are ready to create your first Avatar.

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

Options#

namealiastypedefaultdescription
radiusrnumber0Avatar border radius
dataUriboolfalseReturn avatar as data uri instead of XML
Not supported by the HTTP API
widthwnumbernullFixed width
heighthnumbernullFixed height
marginmnumber0Avatar margin in percent
HTTP-API limitation Max value 25
backgroundbstringnullAny valid color identifier
HTTP-API limitation Only hex (3-digit, 6-digit and 8-digit) values are allowed. Use url encoded hash: %23.
colorsarray of stringsnullPossible values: amber, blue, blueGrey, brown, cyan, deepOrange, deepPurple, green, grey, indigo, lightBlue, lightGreen, lime, orange, pink, purple, red, teal, yellow
colorLevelnumber600Possible values: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900