1.0.0-alpha.25 • Published 12 months ago

@talixo/avatar v1.0.0-alpha.25

Weekly downloads
8
License
MIT
Repository
github
Last release
12 months ago

Talixo Avatar

UI Component which represents Avatar

How to install

Package is available as @talixo/avatar in NPM registry, so you can use it in your project using npm install @talixo/avatar --save or yarn add @talixo/avatar.

Requirements

Your package should additionally have some extra dependencies:

  • @talixo/icon: ^1.0.0-alpha.24
  • @talixo/shared: ^1.0.0-alpha.24
  • prop-types: ^15.6.1
  • react: ^16.2.0
  • react-dom: ^16.2.0

These packages are required by @talixo/avatar, but you have to install them manually, to avoid having different versions of these in your application.

Supported props

It allows any props which are allowed for div. Additionally, it handles some differently:

Property nameTypeDefaultDescription
altstringn/aAlt attribute for the rendered img element.
classNamestringn/aAdditional class name.
childrenstringn/aText displayed inside avatar.
defaultIconstringn/aDefault icon displayed inside avatar.
defaultTextstringn/aDefault text displayed inside avatar.
iconstringn/aIcon displayed inside avatar.
imgPropsobjectn/aAdditional props passed to rendered img element.
renderfunctionAvatarChildRendererFormat avatar's children.
roundedbooleanfalseControls whether avatar is circular or square.
sizenumber40Size of the avatar in pixels.
srcstringn/aImage displayed inside avatar.
srcSetstringn/aImage set displayed inside avatar.
styleobjectn/aStyle passed to wrapper.

Changelog

  • 0.1.0 - initial version