Materialish

Avatar

An Avatar repesents a user. Avatars can display an image representing the user, or their initials.

🙌 Heads up! This code is editable. The preview above will update to reflect your changes.

Usage

import { Avatar } from 'materialish';
import 'materialish/materialish.css';

Props

Prop NameDefault ValueDescription
classNameAdditional class name(s) to add to the Avatar
imageThe URL for the user's picture
initialsThe user's initials
nodeRefPass a ref to get access to the root node
...restOther props are placed on the root element of the Avatar

CSS Variables

VariableDefault ValueDescription
--mt-baseFontSize1remThe text size and dimensions of the avatar are based off of this value
--mt-fontFamily'Roboto'The font family to use for text
--mt-avatar-backgroundColor#cccThe background color of the avatar
--mt-avatar-color#333The text color of the avatar

Useful Links