https://github.com/clydedz/uiavatars-npm
Generate avatar images based on user initials
https://github.com/clydedz/uiavatars-npm
avatar avatar-generator avatars html initials javascript javascript-library npm npm-package profile profile-picture typescript ui-avatars uiavatars user user-initals
Last synced: 11 months ago
JSON representation
Generate avatar images based on user initials
- Host: GitHub
- URL: https://github.com/clydedz/uiavatars-npm
- Owner: ClydeDz
- License: mit
- Created: 2019-05-24T10:08:10.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T17:42:42.000Z (over 3 years ago)
- Last Synced: 2024-11-17T10:13:53.109Z (over 1 year ago)
- Topics: avatar, avatar-generator, avatars, html, initials, javascript, javascript-library, npm, npm-package, profile, profile-picture, typescript, ui-avatars, uiavatars, user, user-initals
- Language: JavaScript
- Homepage: http://bit.ly/ui-avatars
- Size: 160 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UI Avatars
Generate avatar images based on user initials.
[](https://clydedsouza.visualstudio.com/UI%20Avatars%20npm/_build/latest?definitionId=26)


[](https://app.codacy.com/app/ClydeDz/uiavatars-npm?utm_source=github.com&utm_medium=referral&utm_content=ClydeDz/uiavatars-npm&utm_campaign=Badge_Grade_Dashboard)

[](http://bit.ly/ui-avatars)
## Usage
After installing, simply import it in your file.
```javascript
const uiavatars = require("ui-avatars");
```
Consume the `generateAvatar()` API to get an avatar URL that you can use directly as an image. Supply the settings object to this method to generate the avatar image URL accordingly. You can either supply one or all settings, based on your requirement. All settings are pretty self-explanatory.
```javascript
var avatarURL = uiavatars.generateAvatar({
uppercase: true,
name: "Tony Stark",
background: "990000",
color: "000000",
fontsize: 0.5,
bold: true,
length: 2,
rounded: true,
size: 250
});
```
## Examples
> Clicking on the images below opens the image in a browser window.
[](https://ui-avatars.com/api/?background=990000&color=fff&name=Clyde%20D%27Souza&size=120)
[](https://ui-avatars.com/api/?bold=true&size=120)
[](https://ui-avatars.com/api/?name=Tony%20Stark&length=1&size=120&font-size=0.8&background=23ff6c&color=000000)
## Release notes
Release notes can be found [here](https://github.com/ClydeDz/uiavatars-npm/releases).
## License
This npm package is licensed under MIT. [UI Avatars](https://ui-avatars.com/) may be licensed separately.
## Credits
[UI Avatars](https://ui-avatars.com/) developed by [Lasse Rafn](https://twitter.com/lasserafn) / [GitHub](https://github.com/LasseRafn/ui-avatars).
This npm package is developed by [Clyde D'Souza](https://clydedsouza.net).