Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kayyz1/simple-generic-avatar
Dead simple avatar generator
https://github.com/kayyz1/simple-generic-avatar
Last synced: about 2 months ago
JSON representation
Dead simple avatar generator
- Host: GitHub
- URL: https://github.com/kayyz1/simple-generic-avatar
- Owner: kayYZ1
- License: mit
- Created: 2024-09-14T16:02:18.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-09-16T18:42:00.000Z (3 months ago)
- Last Synced: 2024-09-17T02:49:36.154Z (3 months ago)
- Language: TypeScript
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple Generic Avatar
simple-generic-avatar is a lightweight(kind of) npm package that generates a simple avatar as an SVG. The avatar displays initials based on a given name with colors and comes with different sizes.
## Usage/Examples
```javascript
import { generateAvatar } from 'simple-generic-avatar';const myImage = generateAvatar('John', 'Doe', 32, 'violet');
function ReactApp() {
;
}
```Image can be used as an 'src' in design librariers or frameworks such as NextJS and it's tag.
```javascript
import { generateAvatar } from 'simple-generic-avatar'const myImage = generateAvatar("John", "Doe", 32, "violet")
function NextApp() {
}
```## Documentation
Package exports single function named _generateAvatar_. There are only 4 values that can be passed as props:
- _name_ - John
- _surname_ - Doe
- _size_ - Square format only, ex. 16 - 16x16, 64 - 64x64 etc.
- _color_? - Color as a one of the given string values (ex. "red"). If not provided, color will be randomized.## Authors
- [@kayYZ1](https://www.github.com/kayYZ1)
## License
[MIT](https://choosealicense.com/licenses/mit/)