Skip to content
Tutorials Center
My learning

Topics

Lesson 7 of 36 ยท Components and Props

Paper, Card, Avatar and Chip

Build surfaces and content blocks with Material UI: Paper elevation and outlined variants, the Card family, CardActionArea, Avatar, Divider and deletable Chips.

Most screens are built from surfaces: rectangles that group related content. Material UI provides Paper as the basic surface, Card as a ready-made content block, Avatar for pictures and initials, and Chip for compact tags and filters. This lesson shows how they fit together.

Paper: the basic surface

Paper is a div with a background color from the theme and an optional shadow. Its elevation prop (0 to 24) controls how far above the page it looks. Real MUI code (read-only):

JSX
import Paper from '@mui/material/Paper';

<Paper elevation={0} sx={{ p: 2 }}>Flat</Paper>
<Paper elevation={3} sx={{ p: 2 }}>Raised</Paper>
<Paper variant="outlined" sx={{ p: 2 }}>Outlined (border, no shadow)</Paper>
<Paper square sx={{ p: 2 }}>Square corners</Paper>

In dark mode an elevated surface also becomes lighter, which is how Material Design shows depth when shadows are hard to see. That only works if you use Paper (or components built on it: Card, Dialog, Menu, AppBar) instead of a plain div with a fixed background color.

Use variant="outlined" for dense layouts where many shadows would look noisy (dashboards, forms), and elevation for things that actually float (menus, dialogs).

The Card family

Card is a Paper with a few conventions (rounded corners, overflow hidden) and a set of building blocks:

JSX
import Card from '@mui/material/Card';
import CardHeader from '@mui/material/CardHeader';
import CardMedia from '@mui/material/CardMedia';
import CardContent from '@mui/material/CardContent';
import CardActions from '@mui/material/CardActions';

<Card sx={{ maxWidth: 345 }}>
  <CardHeader
    avatar={<Avatar>R</Avatar>}
    title="Rainy afternoon"
    subheader="Posted today"
    action={<IconButton aria-label="more"><MoreVertIcon /></IconButton>}
  />
  <CardMedia component="img" height="160" image="/photo.jpg" alt="Rain on a window" />
  <CardContent>
    <Typography variant="body2" color="text.secondary">
      A short description of the card.
    </Typography>
  </CardContent>
  <CardActions>
    <Button size="small">Share</Button>
    <Button size="small">Learn more</Button>
  </CardActions>
</Card>

Each part is optional. CardContent adds standard padding; CardActions lays out buttons with proper spacing; CardMedia shows an image (use component="img" plus alt for meaningful images, otherwise it renders a background image that screen readers cannot see).

If the whole card is clickable, wrap its content in CardActionArea, which makes it a focusable button-like region with a ripple:

JSX
<Card>
  <CardActionArea href="/articles/42">
    <CardContent>...</CardContent>
  </CardActionArea>
</Card>

Avoid putting separate buttons inside a CardActionArea: interactive elements must not nest. Put the actions outside it, in CardActions.

Stand-in: Paper elevation and a Card

The first stand-in imitates Paper elevations and a composed Card. Slide the elevation value and compare it with the outlined variant.

Stand-in: Paper elevation and Card parts

Avatar and Divider

Avatar shows a user picture, an icon or initials in a circle. It falls back gracefully when the image fails to load:

JSX
<Avatar alt="Ada Lovelace" src="/ada.jpg" />
<Avatar sx={{ bgcolor: 'secondary.main' }}>AL</Avatar>
<Avatar variant="rounded"><FolderIcon /></Avatar>
<AvatarGroup max={3}>
  <Avatar>A</Avatar><Avatar>B</Avatar><Avatar>C</Avatar><Avatar>D</Avatar>
</AvatarGroup>

Divider draws a thin line to separate groups: <Divider />, <Divider orientation="vertical" flexItem />, or <Divider>OR</Divider> with centered text.

Chip

A Chip is a compact element for tags, filters, selections and contacts. Its props tell what kind of chip it is:

JSX
import Chip from '@mui/material/Chip';

<Chip label="React" />
<Chip label="Clickable" onClick={handleClick} />
<Chip label="Deletable" onDelete={handleDelete} />
<Chip label="Outlined" variant="outlined" color="primary" size="small" />
<Chip avatar={<Avatar>M</Avatar>} label="Maya" />
<Chip icon={<FaceIcon />} label="With icon" />
  • Providing onClick makes the chip clickable (a button, focusable).
  • Providing onDelete shows a delete icon; the keyboard Delete/Backspace key also triggers it.
  • Use variant="outlined" for filter chips that toggle between filled (selected) and outlined (not selected).

Stand-in: filter chips

The second stand-in uses clickable chips as filters: selected chips are filled, others are outlined, and the card list reacts. This is a very common pattern.

Stand-in: Chips that filter a list

Common mistakes

  • Using a plain div with background: white instead of Paper; dark mode then breaks.
  • Nesting buttons inside CardActionArea.
  • Missing alt on CardMedia component="img".
  • Using a Chip as a general button. Chips are for tags, filters and selections.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does Paper's elevation prop control?

    elevation selects a shadow level from 0 to 24, and in dark mode it also lightens the surface.
  2. 2. Which component makes an entire Card clickable with keyboard focus and a ripple?

    CardActionArea wraps card content in a focusable, clickable region.
  3. 3. How do you show a delete icon on a Chip?

    When onDelete is provided, the chip renders a delete icon and handles the Delete/Backspace key.
  4. 4. Why prefer Paper over a div with a white background?

    Paper reads background and elevation tones from the theme, which keeps surfaces consistent across modes.

Summary

  • Paper is the base surface: elevation (0-24), variant="outlined", square.
  • Card composes CardHeader, CardMedia, CardContent, CardActions; use CardActionArea for a clickable card.
  • Avatar and AvatarGroup show people; Divider separates content.
  • Chip is for tags and filters; onClick and onDelete define its behavior.

Next: Alerts, Dialogs and Snackbars