Skip to content

Latest commit

 

History

History
56 lines (41 loc) · 1.47 KB

README.md

File metadata and controls

56 lines (41 loc) · 1.47 KB

Avatar React Component

NPM Size JavaScript Style Guide LICENSE

Install

npm install --save @idui/react-avatar
yarn add @idui/react-avatar

See props in Docs

Basic Example

import React from 'react'
import Avatar from '@idui/react-avatar'

function Example({ user }) {
  return <Avatar 
      src={user.avatar} 
      defaultSrc="default.png"
  />
}

With Initials

import React from 'react'
import Avatar from '@idui/react-avatar'

function Example({ user }) {
  return <Avatar 
      src={user.avatar}
      initials={`${user.firstName[0]}${user.lastName[0]}`}
      color="orangered"
  />
}

See more details in storybook

License

MIT © [email protected]