Skip to content

dicebear-browser is a fork of dicebear that allows you to generate avatar images directly in the browser

License

Notifications You must be signed in to change notification settings

hustLer2k/dicebear-browser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dicebear-browser

dicebear-browser is a fork of dicebear that allows you to generate avatar images directly in the browser. The supported methods are toString and toDataUriSync. This makes it ideal for use in web applications that require quick and easy avatar generation. https://www.npmjs.com/package/dicebear-browser

Installation

npm install dicebear-browser

Usage

To generate an avatar, create a new avatar object using createAvatar as described here (https://dicebear.com/how-to-use/js-library), then convert the object with toString or toDataUriSync.

import { createAvatar } from "dicebear-browser/core";
import { botttsNeutral } from "dicebear-browser/collection/lib/index";

const avatar = createAvatar(avatars.botttsNeutral, {
    seed: "Angel",
    backgroundColor: ["1e88e5", "fdd835"],
    backgroundType: ["gradientLinear"],
    backgroundRotation: [-270],
    mouth: ["smile02"],
});
document.querySelector("img").src = avatar.toDataUriSync();

License

DiceBear Browser is licensed under the MIT License.

About

dicebear-browser is a fork of dicebear that allows you to generate avatar images directly in the browser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published