Skip to content
Alea0.1

Layout

Masonry and ImageList

Cards of different heights packed into columns, and image galleries with captions.

Ant Design: Image.PreviewGroup, List grid

import { Masonry, ImageList } from '@alea/ui';

Examples

Masonry

Cards of different heights packed into columns.

Tokens first, components second.

Every chart needs a table view.

Name things for what they do, not how they look. A button that deletes is "Delete", not "Red button".

Motion: fade from 0.01, never 0.

Test in dark and light.

Keyboard first: if it works with Tab and Enter, it usually works with a screen reader too.

Ship small.

Image list

A gallery with captions; links when an href is given.

  • Purple to violet gradient
    Orchidpurple.400
  • Yellow to orange gradient
    Sunriseyellow.200
  • Green to blue gradientLagoon
  • Pink to purple gradient
    Bloom

Props

Masonry props

Cards of different heights packed into columns, Pinterest style (MUI Masonry, Mantine/Ant image lists). Reading order follows the columns top to bottom.

PropTypeDefaultDescription
asListboolean-Render as a list (ul); children should then be li. Default false.
classNamestring-Extra class names for the root element.
columnWidthnumber220Least column width in px; columns are added as space allows. Default 220.
gapnumber12Gap in px. Default 12.

ImageList props

A gallery of images with optional captions (MUI ImageList, Ant Image.PreviewGroup layout).

PropTypeDefaultDescription
itemsrequired{ src: string; alt: string; title?: string | undefined; subtitle?: string | undefined; href?: string | undefined; }[]-Images: src, alt, and an optional title and subtitle shown over the bottom.
classNamestring-Extra class names for the root element.
minItemWidthnumber180Least width of a tile. Default 180.
rationumber1Tile ratio in grid. Default 1.
variant"grid" | "masonry"'grid'grid (same size) or masonry (keeps each image's shape). Default grid.

Accessibility

  • Reading order follows each column top to bottom; keep cards independent of each other.
  • Every image needs alt text.

Do and don't

Do

  • Make each card make sense on its own: the reading order follows the columns.
  • Write alt text for every image.

Don't

  • Don't use it for ordered content (rankings, timelines).
  • Don't put critical actions at the bottom of tall cards.
Tested with axe, keyboard and screen reader roles