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'// orimport CAvatar from '@coreui/react/src/components/avatar/CAvatar'
Property | Description | Type | Default |
---|---|---|---|
className | A string of all className you want applied to the component. | string | - |
color | Sets the color context of the component to one of CoreUI’s themed colors. | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string | - |
shape | Select 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 | - |
size | Size the component small, large, or extra large. | string | - |
src | The src attribute for the img element. | string | - |
status | Sets the color context of the status indicator to one of CoreUI’s themed colors. | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string | - |
textColor | Sets 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 | - |
On this page