Avatar
Image Avatars
Get image avatars by simply using the src
prop.
import React from 'react';
import { Avatar } from 'chic-ui';
<Avatar src="cat1.png" />
<Avatar src="cat2.png" />
<Avatar src="cat3.png" />
Lettered Avatars
Get lettered avatars by simply using the name
prop.
import React from 'react';
import { Avatar } from "chic-ui";
<Avatar name="KS" />
<Avatar name="D" />
Active Avatars
isActive
prop can be used to show active avatars.
import React from 'react';
import { Avatar } from 'chic-ui';
<Avatar name="KS" isActive />
<Avatar src="cat2.png" isActive />
API
import { Avatar } from 'chic-ui';
Name | Type | Default | Description |
---|---|---|---|
src | string | Path of the image for the avatar | |
name | string | Alphabets for the avatar | |
isActive | boolean | false | Active state for the avatar |
width | number | 80 | Width of avatar |
height | number | 80 | Height of avatar |
className | string | Provide external classnames to the component | |
style | React.CSSProperties | Override default styling of the component |