Skip to main content

Personas

Sean Moore Lionel Quinn Lydia Ellis Bryan Phelps Ronald Frank Annette Klein Brent Hill Stanley Newman Grace Singleton

Implementation of Personas by Draftbit by Draftbit - draftbit.com. Licensed under CC BY 4.0.

note

While our code is MIT licensed, the design is licensed under CC BY 4.0. See license overview for more information.

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

See the HTTP API documentation for more information.

NPM#

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

npm install --save @dicebear/avatars @dicebear/personas

Now you are ready to create your first Avatar.

import { createAvatar } from '@dicebear/avatars';
import * as style from '@dicebear/personas';
let svg = createAvatar(style, {
seed: 'custom-seed',
// ... and other options
});

Options#

Base options#

seed

Seed

Alias: s

Default: undefined

Type: string

dataUri

Data URI

Default: false

Type: boolean

flip

Flip

Default: false

Type: boolean

rotate

Rotate

Default: 0

Type: integer

Minimum: 0

Maximum: 360

scale

Scale

Default: 100

Type: integer

Minimum: 0

Maximum: 200

radius

Radius

Alias: r

Default: 0

Type: integer

Minimum: 0

Maximum: 50

size

Size

Default: undefined

Type: integer

Minimum: 1

backgroundColor

Background Color

Alias: b

Default: undefined

Type:

translateX

Translate X%

Default: 0

Type: integer

Minimum: -100

Maximum: 100

translateY

Translate Y%

Default: 0

Type: integer

Minimum: -100

Maximum: 100

Style options#

eyes

Eyes

Default: open, sleep, wink, glasses, happy, sunglasses

Type: array

Items:

Type: string

Enum: open, sleep, wink, glasses, happy, sunglasses

hair

Hair

Default: long, sideShave, shortCombover, curlyHighTop, bobCut, curly, pigtails, curlyBun, buzzcut, bobBangs, bald, balding, cap, bunUndercut, fade, beanie, straightBun, extraLong, shortComboverChops, mohawk

Type: array

Items:

Type: string

Enum: long, sideShave, shortCombover, curlyHighTop, bobCut, curly, pigtails, curlyBun, buzzcut, bobBangs, bald, balding, cap, bunUndercut, fade, beanie, straightBun, extraLong, shortComboverChops, mohawk

body

Body

Default: squared, rounded, small, checkered

Type: array

Items:

Type: string

Enum: squared, rounded, small, checkered

mouth

Mouth

Default: smile, frown, surprise, pacifier, bigSmile, smirk, lips

Type: array

Items:

Type: string

Enum: smile, frown, surprise, pacifier, bigSmile, smirk, lips

nose

Nose

Default: mediumRound, smallRound, wrinkles

Type: array

Items:

Type: string

Enum: mediumRound, smallRound, wrinkles

facialHair

Facial Hair

Default: beardMustache, pyramid, walrus, goatee, shadow, soulPatch

Type: array

Items:

Type: string

Enum: beardMustache, pyramid, walrus, goatee, shadow, soulPatch

hairColor

Hair Color

Default: black, brunette, red, pink, copper, blonde, grey

Type: array

Items:

Type: string

Enum: black, brunette, red, pink, copper, blonde, grey

or

Type: string

Pattern: ^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$

clothingColor

Clothing Color

Default: blue, turquoise, purple, green, red, yellow, pink

Type: array

Items:

Type: string

Enum: blue, turquoise, purple, green, red, yellow, pink

or

Type: string

Pattern: ^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$

skinColor

Skin Color

Default: tone1, tone2, tone3, tone4, tone5, tone6, tone7, tone8

Type: array

Items:

Type: string

Enum: tone1, tone2, tone3, tone4, tone5, tone6, tone7, tone8

or

Type: string

Pattern: ^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$