Shapes
Shapes by DiceBear, licensed under CC0 1.0 .
LICENSE
While our code is MIT licensed, the design of this avatar style is licensed under CC0 1.0. See details for more information.
Usage
Use this URL to request this avatar style via our HTTP API.
https://api.dicebear.com/9.x/shapes/svg
You can use the URL directly as image source.
See HTTP-API docs for more information.
First install the required packages via npm:
npm install @dicebear/core @dicebear/collection --save
Then you can create this avatar as follows:
import { createAvatar } from '@dicebear/core';
import { shapes } from '@dicebear/collection';
const avatar = createAvatar(shapes, {
// ... options
});
const svg = avatar.toString();
See JS-Library docs for more information.
First install the CLI package via npm:
npm install --global dicebear
Then you can create this avatar as follows:
dicebear shapes
See CLI docs for more information.
Options
seed
TypestringThe seed determines the initial value for the built-in PRNG. With the PRNG you can create the same avatar over and over again based.
FelixAnekahttps://api.dicebear.com/9.x/shapes/svg?seed=Felix
createAvatar(shapes, {
seed: "Felix"
});dicebear shapes --seed "Felix"
flip
Typebooleanfalsetruefalsehttps://api.dicebear.com/9.x/shapes/svg?flip=false
createAvatar(shapes, {
flip: false
});dicebear shapes --flip false
rotate
TypeintegerMinimum 0Maximum 3600901802700https://api.dicebear.com/9.x/shapes/svg?rotate=0
createAvatar(shapes, {
rotate: 0
});dicebear shapes --rotate 0
scale
TypeintegerMinimum 0Maximum 20050100200100https://api.dicebear.com/9.x/shapes/svg?scale=50
createAvatar(shapes, {
scale: 50
});dicebear shapes --scale 50
radius
TypeintegerMinimum 0Maximum 50010203040500https://api.dicebear.com/9.x/shapes/svg?radius=0
createAvatar(shapes, {
radius: 0
});dicebear shapes --radius 0
size
TypeintegerMinimum 13248648096https://api.dicebear.com/9.x/shapes/svg?size=32
createAvatar(shapes, {
size: 32
});dicebear shapes --size 32
backgroundColor
TypearrayItem Pattern ^(transparent|[a-fA-F0-9]{6})$b6e3f4c0aeded1d4f9ffd5dcffdfbf0a5b831c799f69d2e7f1f4dcf88c49https://api.dicebear.com/9.x/shapes/svg?backgroundColor=b6e3f4,c0aede,d1d4f9
createAvatar(shapes, {
backgroundColor: ["b6e3f4","c0aede","d1d4f9"]
});dicebear shapes --backgroundColor "b6e3f4" "c0aede" "d1d4f9"
backgroundType
TypearraygradientLinearsolidsolidhttps://api.dicebear.com/9.x/shapes/svg?backgroundType=gradientLinear,solid
createAvatar(shapes, {
backgroundType: ["gradientLinear","solid"]
});dicebear shapes --backgroundType "gradientLinear" "solid"
backgroundRotation
Typearray 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'].
0360https://api.dicebear.com/9.x/shapes/svg?backgroundRotation=0,360
createAvatar(shapes, {
backgroundRotation: [0,360]
});dicebear shapes --backgroundRotation 0 360
translateX
TypeintegerMinimum -100Maximum 100-50-25025500https://api.dicebear.com/9.x/shapes/svg?translateX=-50
createAvatar(shapes, {
translateX: -50
});dicebear shapes --translateX -50
translateY
TypeintegerMinimum -100Maximum 100-50-25025500https://api.dicebear.com/9.x/shapes/svg?translateY=-50
createAvatar(shapes, {
translateY: -50
});dicebear shapes --translateY -50
clip
Typebooleantruehttps://api.dicebear.com/9.x/shapes/svg?clip=true
createAvatar(shapes, {
clip: true
});dicebear shapes --clip true
randomizeIds
TypebooleanThis 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.
falsehttps://api.dicebear.com/9.x/shapes/svg?randomizeIds=false
createAvatar(shapes, {
randomizeIds: false
});dicebear shapes --randomizeIds false
shape1
TypearrayellipseellipseFilledlinepolygonpolygonFilledrectanglerectangleFilledellipseFilledpolygonFilledrectangleFilledhttps://api.dicebear.com/9.x/shapes/svg?shape1=ellipse,ellipseFilled,line
createAvatar(shapes, {
shape1: ["ellipse","ellipseFilled","line"]
});dicebear shapes --shape1 "ellipse" "ellipseFilled" "line"
shape1Color
TypearrayItem Pattern ^(transparent|[a-fA-F0-9]{6})$0a5b831c799f69d2e7f1f4dcf88c49https://api.dicebear.com/9.x/shapes/svg?shape1Color=0a5b83,1c799f,69d2e7
createAvatar(shapes, {
shape1Color: ["0a5b83","1c799f","69d2e7"]
});dicebear shapes --shape1Color "0a5b83" "1c799f" "69d2e7"
shape1OffsetX
TypearrayMax Items 2Specify an array of two numbers for this option. The PRNG will generate a number between the two values, which will be used as offset.
-6565https://api.dicebear.com/9.x/shapes/svg?shape1OffsetX=-65,65
createAvatar(shapes, {
shape1OffsetX: [-65,65]
});dicebear shapes --shape1OffsetX -65 65
shape1OffsetY
TypearrayMax Items 2Specify an array of two numbers for this option. The PRNG will generate a number between the two values, which will be used as offset.
-4545https://api.dicebear.com/9.x/shapes/svg?shape1OffsetY=-45,45
createAvatar(shapes, {
shape1OffsetY: [-45,45]
});dicebear shapes --shape1OffsetY -45 45
shape1Rotation
TypearrayMax Items 2Specify 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.
-160160https://api.dicebear.com/9.x/shapes/svg?shape1Rotation=-160,160
createAvatar(shapes, {
shape1Rotation: [-160,160]
});dicebear shapes --shape1Rotation -160 160
shape2
TypearrayellipseellipseFilledlinepolygonpolygonFilledrectanglerectangleFilledellipseFilledlinepolygonFilledrectangleFilledhttps://api.dicebear.com/9.x/shapes/svg?shape2=ellipse,ellipseFilled,line
createAvatar(shapes, {
shape2: ["ellipse","ellipseFilled","line"]
});dicebear shapes --shape2 "ellipse" "ellipseFilled" "line"
shape2Color
TypearrayItem Pattern ^(transparent|[a-fA-F0-9]{6})$0a5b831c799f69d2e7f1f4dcf88c49https://api.dicebear.com/9.x/shapes/svg?shape2Color=0a5b83,1c799f,69d2e7
createAvatar(shapes, {
shape2Color: ["0a5b83","1c799f","69d2e7"]
});dicebear shapes --shape2Color "0a5b83" "1c799f" "69d2e7"
shape2OffsetX
TypearrayMax Items 2Specify an array of two numbers for this option. The PRNG will generate a number between the two values, which will be used as offset.
-4040https://api.dicebear.com/9.x/shapes/svg?shape2OffsetX=-40,40
createAvatar(shapes, {
shape2OffsetX: [-40,40]
});dicebear shapes --shape2OffsetX -40 40
shape2OffsetY
TypearrayMax Items 2Specify an array of two numbers for this option. The PRNG will generate a number between the two values, which will be used as offset.
-4040https://api.dicebear.com/9.x/shapes/svg?shape2OffsetY=-40,40
createAvatar(shapes, {
shape2OffsetY: [-40,40]
});dicebear shapes --shape2OffsetY -40 40
shape2Rotation
TypearrayMax Items 2Specify 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.
-180180https://api.dicebear.com/9.x/shapes/svg?shape2Rotation=-180,180
createAvatar(shapes, {
shape2Rotation: [-180,180]
});dicebear shapes --shape2Rotation -180 180
shape3
TypearrayellipseellipseFilledlinepolygonpolygonFilledrectanglerectangleFilledellipseellipseFilledlinepolygonpolygonFilledrectanglerectangleFilledhttps://api.dicebear.com/9.x/shapes/svg?shape3=ellipse,ellipseFilled,line
createAvatar(shapes, {
shape3: ["ellipse","ellipseFilled","line"]
});dicebear shapes --shape3 "ellipse" "ellipseFilled" "line"
shape3Color
TypearrayItem Pattern ^(transparent|[a-fA-F0-9]{6})$0a5b831c799f69d2e7f1f4dcf88c49https://api.dicebear.com/9.x/shapes/svg?shape3Color=0a5b83,1c799f,69d2e7
createAvatar(shapes, {
shape3Color: ["0a5b83","1c799f","69d2e7"]
});dicebear shapes --shape3Color "0a5b83" "1c799f" "69d2e7"
shape3OffsetX
TypearrayMax Items 2Specify an array of two numbers for this option. The PRNG will generate a number between the two values, which will be used as offset.
-2525https://api.dicebear.com/9.x/shapes/svg?shape3OffsetX=-25,25
createAvatar(shapes, {
shape3OffsetX: [-25,25]
});dicebear shapes --shape3OffsetX -25 25
shape3OffsetY
TypearrayMax Items 2Specify an array of two numbers for this option. The PRNG will generate a number between the two values, which will be used as offset.
-2525https://api.dicebear.com/9.x/shapes/svg?shape3OffsetY=-25,25
createAvatar(shapes, {
shape3OffsetY: [-25,25]
});dicebear shapes --shape3OffsetY -25 25
shape3Rotation
TypearrayMax Items 2Specify 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.
-180180https://api.dicebear.com/9.x/shapes/svg?shape3Rotation=-180,180
createAvatar(shapes, {
shape3Rotation: [-180,180]
});dicebear shapes --shape3Rotation -180 180
Details
| Naming | |
|---|---|
| Collection Import | import { shapes } from '@dicebear/collection'; |
| Package Import | import * as style from '@dicebear/shapes'; |
| CLI | dicebear shapes |
| HTTP-API | https://api.dicebear.com/9.x/shapes/svg |
| JSON Schema | https://api.dicebear.com/9.x/shapes/schema.json |
| Source | |
|---|---|
| Title | Shapes |
| Creator | DiceBear |
| Website | https://www.dicebear.com |
| License | CC0 1.0 |
| Source | https://www.dicebear.com |