3.0.0-0 • Published 7 years ago

@dicebear/avatars v3.0.0-0

Weekly downloads
2,366
License
MIT
Repository
github
Last release
7 years ago

DiceBear Avatars

license npm

Avatars is a free pixel-art avatar placeholder library with HTTP-API.
Test in your Browser: avatars.dicebear.com

Usage

HTTP-API (recommended)

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

https://avatars.dicebear.com/v3/:sprites/:seed.svg

Replace :sprites with male, female, identicon, gridy or avataaars. The value of :seed can be anything you like - but don't use any sensitive or personal data here!

The used sprite collection may offer additional options, which can be set using the GET parameter named options. For example, to create a happy male avatar with the seed john, the following URL can be used:

https://avatars.dicebear.com/v3/male/john.svg?options[mood]=happy

CDN

Choose the CDN if you want to use a spriteCollection that is not available via the HTTP-API.

Add the following line to the end of the document body.

<script type="text/javascript" src="https://unpkg.com/@dicebear/avatars@2.0.0/dist/avatars.min.js"></script>

You also need to add a sprite collection. In our example, we will use the male sprite collection.

<script type="text/javascript" src="https://unpkg.com/@dicebear/avatars-male-sprites@1.0.0/dist/sprites.min.js"></script>

Now you are ready to create your first Avatar.

var options = {};
var avatars = new Avatars(Avatars.sprites.male(options));
var svg = avatars.create('custom-seed');

NPM

Choose NPM if you want to use Avatars server-side or with webpack.

Install the Avatars package with the following command.

npm install --save @dicebear/avatars

You also need to add a sprite collection. In our example, we will use the male sprite collection.

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

Now you are ready to create your first Avatar.

const Avatars = require('@dicebear/avatars').default;
const SpriteCollection = require('@dicebear/avatars-male-sprites').default;

let options = {};
let avatars = new Avatars(SpriteCollection(options));
let svg = avatars.create('custom-seed');

Or with ES6-Modules:

import Avatars from '@dicebear/avatars';
import SpriteCollection from '@dicebear/avatars-male-sprites';

let options = {};
let avatars = new Avatars(SpriteCollection(options));
let svg = avatars.create('custom-seed');

Further informations

You can find the complete documentation at avatars.dicebear.com

4.10.8

2 years ago

4.10.6

2 years ago

4.10.7

2 years ago

4.10.5

3 years ago

4.10.4

3 years ago

4.10.3

3 years ago

4.10.2

3 years ago

4.10.1

4 years ago

4.10.0

4 years ago

4.9.1

4 years ago

4.9.0

4 years ago

4.8.5

4 years ago

4.8.6

4 years ago

4.8.4

4 years ago

4.8.1

4 years ago

4.8.0

4 years ago

4.8.3

4 years ago

4.8.2

4 years ago

4.8.0-alpha.0

4 years ago

4.8.0-alpha.1

4 years ago

4.7.4

4 years ago

4.7.3

4 years ago

4.7.2

4 years ago

4.7.1

4 years ago

4.7.0

4 years ago

4.6.10

4 years ago

4.6.7

4 years ago

4.6.6

4 years ago

4.6.9

4 years ago

4.6.8

4 years ago

4.6.5

4 years ago

4.7.0-alpha.1

4 years ago

4.7.0-alpha.0

4 years ago

4.7.0-rc.0

4 years ago

4.6.1

4 years ago

4.6.0

4 years ago

4.6.0-rc.4

4 years ago

4.6.0-rc.2

4 years ago

4.6.0-rc.3

4 years ago

4.6.3

4 years ago

4.6.2

4 years ago

4.6.4

4 years ago

4.6.0-rc.1

4 years ago

4.5.4

4 years ago

4.5.3

4 years ago

4.5.2

4 years ago

4.5.1

4 years ago

4.5.0

4 years ago

4.4.1

5 years ago

4.4.0

5 years ago

4.3.0

5 years ago

4.2.5

5 years ago

4.2.3

5 years ago

4.2.1

5 years ago

4.2.0

5 years ago

4.1.1

5 years ago

4.1.0

5 years ago

4.1.0-alpha.0

5 years ago

4.0.8

5 years ago

4.0.5

5 years ago

4.0.3

5 years ago

4.0.2

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.1.4

6 years ago

3.1.3

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.7

6 years ago

3.0.6

6 years ago

3.0.5

6 years ago

3.0.4

6 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

3.0.0-alpha.6

6 years ago

3.0.0-3

6 years ago

3.0.0-2

7 years ago

3.0.0-1

7 years ago

3.0.0-0

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

2.0.0-beta.9

7 years ago

2.0.0-beta.8

7 years ago

2.0.0-beta.7

7 years ago

2.0.0-beta.6

7 years ago

2.0.0-beta.5

7 years ago

2.0.0-beta.4

7 years ago

2.0.0-beta.3

7 years ago

2.0.0-beta.2

7 years ago

2.0.0-beta.1

7 years ago

2.0.0-alpha.4

7 years ago

2.0.0-alpha.3

7 years ago

2.0.0-alpha.2

7 years ago

2.0.0-alpha.1

7 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago