Jdenticon

Jdenticon wrapper for DiceBear Avatars.

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/jdenticon/:seed.svg

See the HTTP API documentation for more information.

Examples#

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

NPM#

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

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

Now you are ready to create your first Avatar.

import Avatars from '@dicebear/avatars';
import sprites from '@dicebear/avatars-jdenticon-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.
huesarray of numbers between 0 and 360nullIcon hue
colorLightnessarray of two numbers between 0 and 1nullColored shapes - Lightness
grayscaleLightnessarray of two numbers between 0 and 1nullGrayscale shapes - Lightness
colorSaturationnumber between 0 and 1nullColored shapes - Saturation
grayscaleSaturationnumber between 0 and 1nullGrayscale shapes - Saturation