Skip to main content

Initials

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

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/initials/: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/avatars-initials-sprites

Now you are ready to create your first Avatar.

import { createAvatar } from '@dicebear/avatars';
import * as style from '@dicebear/avatars-initials-sprites';
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

radius

Radius

Alias: r

Default: 0

Type: integer

Minimum: 0

Maximum: 50

width

Width

Alias: w

Default: undefined

Type: integer

Minimum: 1

height

Height

Alias: h

Default: undefined

Type: integer

Minimum: 1

margin

Margin

Alias: m

Default: 0

Type: integer

Minimum: 0

Maximum: 25

backgroundColor

Background Color

Alias: b

Default: transparent

Type: string

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

or

Type: string

Enum: transparent

Style options#

backgroundColors

Background Colors

Default: undefined

Type: array

Items:

Type: string

Enum: amber, blue, blueGrey, brown, cyan, deepOrange, deepPurple, green, grey, indigo, lightBlue, lightGreen, lime, orange, pink, purple, red, teal, yellow

backgroundColorLevel

Background Color Level

Default: 600

Type: integer

Enum: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900

fontSize

Font Size

Default: 50

Type: integer

Minimum: 1

Maximum: 100

chars

Chars

Default: 2

Type: number

Minimum: 0

Maximum: 2

bold

Bold

Default: undefined

Type: boolean