React Avatar Component

React avatar component can be used to display circular user profile pictures. Avatar can be used to portray people or objects. It supports images, icons, or letters.

Other frameworks

CoreUI components are available as native Angular, Bootstrap (Vanilla JS), and Vue components. To learn more please visit the following pages.

Image avatars#

<CAvatar src={Avatar1} />
<CAvatar src={Avatar2} />
<CAvatar src={Avatar3} />

Letter avatars#

CUI
CUI
CUI
<CAvatar color="primary" textColor="white">CUI</CAvatar>
<CAvatar color="secondary">CUI</CAvatar>
<CAvatar color="warning" textColor="white">CUI</CAvatar>

Rounded avatars#

Use the shape="rounded" prop to make react avatars squared with rounded corners.

CUI
CUI
CUI
<CAvatar color="primary" textColor="white" shape="rounded">CUI</CAvatar>
<CAvatar color="secondary" shape="rounded">CUI</CAvatar>
<CAvatar color="warning" textColor="white" shape="rounded">CUI</CAvatar>

Square avatars#

Use the shape="rounded-0" prop to make react avatars squared.

CUI
CUI
CUI
<CAvatar color="primary" textColor="white" shape="rounded-0">CUI</CAvatar>
<CAvatar color="secondary" shape="rounded-0">CUI</CAvatar>
<CAvatar color="warning" textColor="white" shape="rounded-0">CUI</CAvatar>

Sizes#

Fancy larger or smaller react avatar component? Add size="xl", size="lg" or size="sm" for additional sizes.

CUI
CUI
CUI
CUI
<CAvatar color="secondary" size="xl">CUI</CAvatar>
<CAvatar color="secondary" size="lg">CUI</CAvatar>
<CAvatar color="secondary">CUI</CAvatar>
<CAvatar color="secondary" size="sm">CUI</CAvatar>

Avatars with status#

CUI
<CAvatar src={Avatar1} status="success" />
<CAvatar color="secondary" status="danger">CUI</CAvatar>

API#

CAvatar#

import { CAvatar } from '@coreui/react'
// or
import CAvatar from '@coreui/react/src/components/avatar/CAvatar'
PropertyDescriptionTypeDefault
classNameA string of all className you want applied to the component.string-
colorSets the color context of the component to one of CoreUI’s themed colors.'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string-
shapeSelect the shape of the component.'rounded' | 'rounded-top' | 'rounded-end' | 'rounded-bottom' | 'rounded-start' | 'rounded-circle' | 'rounded-pill' | 'rounded-0' | 'rounded-1' | 'rounded-2' | 'rounded-3' | string-
sizeSize the component small, large, or extra large.string-
srcThe src attribute for the img element.string-
statusSets the color context of the status indicator to one of CoreUI’s themed colors.'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string-
textColorSets the text color of the component to one of CoreUI’s themed colors.'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'white' | 'muted' | 'high-emphasis' | 'medium-emphasis' | 'disabled' | 'high-emphasis-inverse' | 'medium-emphasis-inverse' | 'disabled-inverse' | string-