To install, type the following into the command line at the root of your project:
npm i @brighthr/component-avatar
To implement the Avatar component into your project you’ll need to add the import:
import Avatar from '@brighthr/component-avatar';
After adding import into your project you can use it simply like:
<Avatar />
Name | Type | Default | Description |
---|---|---|---|
imageHref | string |
Sets the src attribute for the <img /> . |
|
name | string |
Sets the initials to be shown if no imageHref is provided. Also sets image alt and tooltip on hover. |
|
presence |
'in' 'out' 'absent'
|
Sets a different colored circle at the bottom of the avatar. | |
size |
'xxs' 'xs' 'sm' 'base' 'lg' 'xl' 'xxl'
|
Sets the size of the avatar. |