Skip to content
Stylhero 0.8.0
Components

Core

Layout and type

Inputs

Overlays

Navigation

Data display

Charts

Transitions and utilities

Page pieces (landing pages, portfolios, docs)

Icons

Components / Layout and type

Masonry

Cards of different heights packed into columns, Pinterest-style (MUI Lab's Masonry). Items flow top-to-bottom per column.

import { Masonry } from "@stylhero/ui";

Example

Code
import { Masonry, Paper } from "@stylhero/ui";

function MasonryExample() {
  return (
    <Masonry columns={3} gap={3}>
      {[80, 140, 100, 60, 120, 90].map((h, i) => <Paper key={i} outlined style={{ height: h }} padding={3}>{i + 1}</Paper>)}
    </Masonry>
  );
}

Props

PropTypeDefaultDescription
columns number 3
gap Space 4

Also takes every <div> attribute (id, style, data-*, aria-*, event handlers…), passed to that element.

Types

type Space = 0 | 1 | 2 | 3 | 4 | 6 | 8 | 12;

Generated from src/components/ImageList.tsx. Something wrong or missing? Open an issue.