1.1.3 • Published 4 years ago

@airmeet/react-initial v1.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

React Initial

npm version License Dependency Status devDependency Status npm

Simple react component to make Gmail like text avatars for profile pictures.

example

Browser compatibility

  • Chrome
  • Firefox
  • Opera 9+
  • Safari 3.2+
  • iOS Safari 3.2+
  • Android Browser 3+

Usage

import React from 'react'
import ReactDOM from 'react-dom'
import { Initial } from 'react-initial'

const App = () => (
  <Initial name='Bruno Carvalho de Araujo' />
)

ReactDOM.render(<App />, document.getElementById('root'))

Props

The Initial component takes a couple of props that you can use to customize its behaviour:

ProptypeDescriptionDefault
namestringName of the user which the profile picture should be generatedName
heightnumberHeight of the picture100
widthnumberWidth of the picture100
charCountnumberNumber of characherts to be shown in the picture.1
textColorstringColor of the text#ffffff
fontSizenumberFont size of the character(s)60
fontWeightnumberFont weight of the character(s)400
radiusnumberRounded corners0
seednumberNumber to randomize the background color0
colorstringBackground color of the profile picture that should be generatednull

References to create project