Installation
yarn add @react-spectre/avatar
npm install @react-spectre/avatar --save
Usage
Avatar
Avatars are user profile pictures.
import { Avatar, Presence, Icon } from '@react-spectre/avatar'
<Avatar src="img/avatar-1.png" icon />
<Avatar src="assets/react-spectre-logo.png" lg>
<Avatar.Icon src="img/avatar-2.png" />
</Avatar>
<Avatar initial={'YZ'} style={{ backgroundColor: '#5755d9' }} xl>
<Avatar.Presence online />
</Avatar>
Note: The main component is
Avatar
, other component can be accessed through it, for example:Avatar.Presence
andAvatar.Icon
.