Avatar
Component to represent user, and displays the profile picture, initials or fallback icon.
Import
import { Avatar, AvatarBadge, AvatarGroup } from 'react-native-ficus-ui';
Usage
Avatar with photo
Avatar with icon
Generated color
Color scheme
Avatar group
Avatar badge
Avatar badge and group
Props
Extends every Box
and Text
props.
colorScheme
The colorScheme property, will define background color and text color.
Type | Required | Default |
---|---|---|
string | Yes | gray |
icon
The icon property, icon is used as fallback when name, and src is not specified.
Type | Required |
---|---|
string, React Element | No |
name
The name property representing the name of the person in the avatar. If src has loaded, the name will be used as the alt attribute of the img, else, the name will be used to create the initials.
Type | Required |
---|---|
string | No |
size
The size property, defining the size of avatar
Type | Required |
---|---|
string | No |
src
The src property. The source of avatar image
Type | Required |
---|---|
string | No |
AvatarGroup props
Extends every Stack
props.
size
The size property, defining the size of Avatar childrens
Type | Required |
---|---|
string | No |
max
The max property, defining the max number of Avatar childrens that should be displayed. If there are more to display, an item indicating the number of others avatars will be displayed
Type | Required |
---|---|
number | No |
AvatarBadge props
Extends every Box
props.