Skip to main content

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

PropertyTypeDefaultRequiredDescription
accessibilityLabelAvatarString-NoAllows setting the alt attribute of the avatar.
classNameString-NoAllows extending the class names.
size'sm' | 'md' | 'lg' | 'xl''md'NoDetermines the height and width.
srcString-NoAllows setting the native image source.