3.0.2 • Published 5 years ago

react-ui-avatars v3.0.2

Weekly downloads
9
License
MIT
Repository
github
Last release
5 years ago

react-ui-avatars

Wrapper component for https://ui-avatars.com

Generate avatars from a users intials.

Credit to @LasseRafn for his awesome API.

Demo

https://codepen.io/novigradian/pen/qMwJgg

Installing

Using npm:

npm install react-ui-avatars

Usage

import ReactDOM from 'react-dom';
import React from 'react';
import UIAvatar from 'react-ui-avatars';

ReactDOM.render(
  <UIAvatar name='Warren Zevon' color='#551a8b' />,
  document.getElementById('#container')
);

Options

Pass props same as specified at https://ui-avatars.com.

Example:

<UIAvatar name='Warren Zevon' size={128} />

Extra props are passed on to <img /> element.

Global Settings

Global settings for your app can be configured. The properties are the same as the props.

The global settings can be overriden on an individual instance of the component by passing the prop.

import ReactDOM from 'react-dom';
import React from 'react';
import UIAvatar from 'react-ui-avatars';

UIAvatar.settings = {
  size: 128,
  rounded: true
};

ReactDOM.render(
  <UIAvatar name='Warren Zevon' />,
  document.getElementById('#container')
);
3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago