Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-nice-avatar

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-nice-avatar

react library for generating avatar

  • 1.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
decreased by-2.04%
Maintainers
1
Weekly downloads
 
Created
Source

react-nice-avatar

Version npm download Netlify Status

Online editor / preview

Assets

Installation

npm install react-nice-avatar

or

yarn add react-nice-avatar

Usage

  1. Import the component
    import Avatar, { genConfig } from 'react-nice-avatar'
    
  2. Generate random config, the config can be saved into your database to use later
    const config = genConfig(AvatarConfig?)
    
  3. Render the component with specific width / height and configuration
    <Avatar style={{ width: '8rem', height: '8rem' }} {...config} />
    
    or
    <Avatar className="w-32 h-32" {...config} />
    

Options

The options can be passed into genConfig or as React props

keytypedefaultaccepttips
idstringOnly for React Props
classNamestringOnly for React Props
styleobjectOnly for React Props
shapestringcirclecircle, rounded, squareOnly for React Props
sexstringman, woman
faceColorstring
earSizestringsmall, big
hairColorstring
hairStylestringnormal, thick, mohawk, womanLong, womanShort
hairColorRandombooleanfalsethick,mohawk default only be black
eyeStylestringcircle, oval, smile
glassesStylestringnone, round, squareUsually is none
noseStylestringshort, long, round
mouthStylestringlaugh, smile, peace
shirtStylestringhoody, short, polo
shirtColorstring
bgColorstring

Development

  1. Clone the repo:
    $ git clone git@github.com:chilllab/react-nice-avatar.git
    $ cd react-nice-avatar
    
  2. Install dependencies:
    $ yarn
    
    Or
    $ npm install
    
  3. Start the server for the demo:
    $ make dev
    
  4. Open the browser to reivew the demo:
    $ open http://localhost:5555
    
  5. Edit the files inside src.

License

Released under MIT by @chilllab.

Keywords

FAQs

Package last updated on 16 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc