Avatar: React
Avatars are commonly used to represent a user and can contain photos.
Installation
Before you can start using the @mediahuis/chameleon-react
component, you’ll need to install it, for more information check: Getting started for developers.
With that done, you’re now ready to implement the component in your application.
import { Avatar } from '@mediahuis/chameleon-react';
export default function Example() {
return <Avatar src="example.jpg" />;
}
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
accessibilityLabelAvatar | String | - | No | Allows setting the alt attribute of the avatar. |
className | String | - | No | Allows extending the class names. |
size | 'sm' | 'md' | 'lg' | 'xl' | 'md' | No | Determines the height and width. |
src | String | - | No | Allows setting the native image source. |