0.1.0 • Published 9 months ago

nice-color-boring-avatars v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

Nice color boring avatars

Using Boring Avatars under the hood to generate custom, SVG-based avatars from any username, this library adds a list of 100 color palettes and applies it to the avatar automatically based on the provided username.

Install

npm install nice-color-boring-avatars

Usage

import GeneratedAvatar from 'nice-color-boring-avatars';

<GeneratedAvatar name="Maria Mitchell" />;

Props

PropTypeDefault
sizenumber or string40px
squarebooleanfalse
titlebooleanfalse
namestringClara Barton
variantoneOf: marble, beam, pixel,sunset, ring, bauhausmarble

Name

The name prop is used to generate the avatar. It can be the username, email or any random string.

<GeneratedAvatar name="Maria Mitchell"/>

Variant

The variant prop is used to change the theme of the avatar. The available variants are: marble, beam, pixel, sunset, ring and bauhaus.

<GeneratedAvatar name="Alice Paul" variant="beam"/>

Size

The size prop is used to change the size of the avatar.

<GeneratedAvatar name="Ada Lovelace" size={88}/>

Square

The square prop is used to make the avatar square.

<GeneratedAvatar name="Helen Keller" square/>