Sign up and get 15% off every plan.

Sign up
Menu
Data displayMaterial UIMIT licenceFree

Avatar

A round badge with someone's initials, in a few colours.

Add it to your project

Or install the packages yourselfTerminal
npm install @mui/material

The code

components/avatar-demo.tsxReact
/**
 * Demo from Material UI, https://mui.com/material-ui/ (docs demo LetterAvatars)
 * MIT License, Copyright (c) 2014 Call-Em-All. Full text: https://github.com/mui/material-ui/blob/master/LICENSE
 */
'use client';
import Avatar from '@mui/material/Avatar';
import Stack from '@mui/material/Stack';
import { deepOrange, deepPurple } from '@mui/material/colors';

export default function LetterAvatars() {
  return (
    <Stack direction="row" spacing={2}>
      <Avatar>H</Avatar>
      <Avatar sx={{ bgcolor: deepOrange[500] }}>N</Avatar>
      <Avatar sx={{ bgcolor: deepPurple[500] }}>OP</Avatar>
    </Stack>
  );
}