Skip to content

abhijithvijayan/react-initials-avatar

Repository files navigation

react-initials-avatar

🙋‍♂️ Made by @abhijithvijayan

Donate: PayPal, Patreon

Buy Me a Coffee


❤️ it? ⭐️ it on GitHub or Tweet about it.

Table of Contents

Installation

Ensure you have Node.js 10 or later installed. Then run the following:

# via npm
npm install react-initials-avatar

# or yarn
yarn add react-initials-avatar

Usage

import React from 'react';

import InitialsAvatar from 'react-initials-avatar';
import 'react-initials-avatar/lib/ReactInitialsAvatar.css';

function App() {
    return (
      <>
        <InitialsAvatar name="Sherlock Holmes" />
      </>
    );
}

API

name

Type: string

Name for Initials generation

className

Type: string

Default: initial-avatar (with basic styles if css file is imported)

class name for the root div element.

Issues

Looking to contribute? Look for the Good First Issue label.

🐛 Bugs

Please file an issue here for bugs, missing documentation, or unexpected behavior.

See Bugs

Linting & TypeScript Config

License

MIT © Abhijith Vijayan