Skip to content
On this page
Sponsor

Shapes

This implementation is a remix of Shapes by Florian Körner. Licensed under CC0 1.0.

LICENSE

While our code is MIT licensed, the design is licensed under CC0 1.0. See details for more information.

Usage

Options

seed

Type string

The seed determines the initial value for the built-in PRNG. With the PRNG you can create the same avatar over and over again based.

flip

Type boolean

rotate

Type integerMinimum 0Maximum 360

scale

Type integerMinimum 0Maximum 200

radius

Type integerMinimum 0Maximum 50

size

Type integerMinimum 1

backgroundColor

Type arrayItem Pattern ^(transparent|[a-fA-F0-9]{6})$

backgroundType

Type array

backgroundRotation

Type array

Specify an array of two numbers for this option. The PRNG will generate a number between the two values, which will be used as the rotation degree. The rotation is only visible if backgroundType is set to ['gradientLinear'].

translateX

Type integerMinimum -100Maximum 100

translateY

Type integerMinimum -100Maximum 100

clip

Type boolean

randomizeIds

Type boolean

This option randomize the IDs in the generated SVG / XML. This can be useful for example if the avatars are included directly in the HTML and you want to avoid ID collisions.

shape1

Type array

shape1Color

Type arrayItem Pattern ^(transparent|[a-fA-F0-9]{6})$

shape1OffsetX

Type arrayMax Items 2

Specify an array of two numbers for this option. The PRNG will generate a number between the two values, which will be used as offset.

shape1OffsetY

Type arrayMax Items 2

Specify an array of two numbers for this option. The PRNG will generate a number between the two values, which will be used as offset.

shape1Rotation

Type arrayMax Items 2

Specify an array of two numbers for this option. The PRNG will generate a number between the two values, which will be used as the rotation degree.

shape2

Type array

shape2Color

Type arrayItem Pattern ^(transparent|[a-fA-F0-9]{6})$

shape2OffsetX

Type arrayMax Items 2

Specify an array of two numbers for this option. The PRNG will generate a number between the two values, which will be used as offset.

shape2OffsetY

Type arrayMax Items 2

Specify an array of two numbers for this option. The PRNG will generate a number between the two values, which will be used as offset.

shape2Rotation

Type arrayMax Items 2

Specify an array of two numbers for this option. The PRNG will generate a number between the two values, which will be used as the rotation degree.

shape3

Type array

shape3Color

Type arrayItem Pattern ^(transparent|[a-fA-F0-9]{6})$

shape3OffsetX

Type arrayMax Items 2

Specify an array of two numbers for this option. The PRNG will generate a number between the two values, which will be used as offset.

shape3OffsetY

Type arrayMax Items 2

Specify an array of two numbers for this option. The PRNG will generate a number between the two values, which will be used as offset.

shape3Rotation

Type arrayMax Items 2

Specify an array of two numbers for this option. The PRNG will generate a number between the two values, which will be used as the rotation degree.

Details

Naming
Collection Import
import { shapes } from '@dicebear/collection';
Package Import
import * as style from '@dicebear/shapes';
CLI
dicebear shapes
HTTP-APIhttps://api.dicebear.com/5.x/shapes/svg
Source
TitleShapes
CreatorFlorian Körner
Websitehttps://dicebear.com
LicenseCC0 1.0
Sourcehttps://dicebear.com