React Avatar Component API

Avatar API

Explore the API reference for the React Avatar component and discover how to effectively utilize its props for customization.

On this page

CAvatar

jsx
import { CAvatar } from '@coreui/react-pro'
PropertyDefaultType
ariaStatusLabel6.0.0+-string

Names the status indicator for assistive technologies. The indicator is a few pixels of color and nothing else, so a state that carries meaning has to be named; without this the indicator stays decorative.

className-string

A string of all className you want applied to the component.

colorDeprecated 6.0.0-'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'inverse', string

Sets the color context of the component to one of CoreUI’s themed colors.

Use theme instead — color renders the same theme-{color} class and loses to theme when both are set.

shape-'rounded', 'rounded-top', 'rounded-end', 'rounded-bottom', 'rounded-start', 'rounded-circle', 'rounded-pill', 'rounded-0', 'rounded-1', 'rounded-2', 'rounded-3', string

Select the shape of the component.

size-'xs', 'sm', 'md', 'lg', 'xl'

Size the component extra small to extra large.

src-string

The src attribute for the img element.

status-'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'inverse', string

Sets the color context of the status indicator to one of CoreUI’s themed colors.

theme6.0.0+-'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'inverse', string

Sets the color context of the component to one of CoreUI’s themed colors.

variant6.0.0+-'subtle'

Set the avatar variant. The default is solid.