Free & open source, built for every frontend stack. Star Exhuma on GitHub
ExhumaBeta
DocsComponentsBlog

Getting Started

  • Introduction
  • Installation
  • Theming & Dark Mode
  • CLI Reference

Architecture

  • Kinetic Methodology
  • Ecosystem Contracts
  • Lifecycle & Memory Safety

Components

  • All Components20
Cards8
  • Stacking Cards
  • Horizontal Scroller
  • Tilt Card
  • Spotlight Card
  • Border Beam
  • Card Swipe Stack
  • Comparison Slider
  • Expandable Card
Layouts6
  • CSS Masonry
  • Row Masonry
  • Auto Grid
  • Infinite Marquee
  • Bento Grid
  • Diamond Grid
Navigation2
  • Morphing Tabs
  • Floating Dock
Primitives4
  • Accordion
  • Number Ticker
  • Magnetic Button
  • Cursor Tooltip
// DOCS·Components·Layouts

CSS Masonry

Pure CSS multi-column responsive masonry layout with zero external JavaScript runtime overhead.

Target Environment
+
+
CLI Installation
React
$pnpm dlxexhumaaddcss-masonry--flavor=react
// 01·Workbench

Interactive Specification & Studio

layouts
Preset:
Viewport
Fluid 100%
120 FPS NATIVE#01

Zero Layout Shift

Deterministic layout calculation

Compositor Thread0.02ms
KINEMATICS#02

Hermite Spline Acceleration

Nonlinear velocity curves preserving fluid frame timing during continuous inertial scrolling.

Hermite Cubic3t² - 2t³
“

CSS multi-column executes directly on the compositor thread with zero JavaScript runtime overhead.

Architecture Core#03
PHYSICS#04

Runge-Kutta 4th Order

Micro-interaction spring simulation with RK4 numerical integration.

Stiffness170 k
Damping26 c
RK4 Solver0.016ms Step
Universal Native#05
ReactVueSvelteAstroSolid
13 EcosystemsUniversal Native
masonry.css
#06
column-count: 1;
break-inside: avoid;
column-fill: balance;
CSS Multi-ColumnZero Script
Compositor Latency#07
< 0.04ms
GPU IsolatedZero Jitter
RENDER PASS#08

Spatial Void Elimination

Staggered elements interlock fluidly to eliminate vertical blank gaps across varying column heights.

Sub-Pixel GridAuto Balanced
WCAG AAA COMPLIANT#09

DOM Order Flow Integrity

Keyboard tab sequence preserved

Screen Reader OKA11y Validated
Parameters
8 Props
// 02·Usage

Quick Start & Consumer Example

Copy-paste ready implementation for React (.tsx). Automatically updates when you modify parameters in the Workbench above.

+
+
CssMasonryDemo.tsx
React (.tsx)
import React from 'react';
import { CssMasonry } from '@/components/ui/CssMasonry';

const TILES = [
  { id: '01', title: 'Quantum Sub-Pixel Masonry', desc: 'Hardware-composited multi-column tracks with zero reflow penalties.', heightClass: 'h-48', tag: '01 // GPU' },
  { id: '02', title: 'Continuous Fluid Flow', desc: 'Elements cascade naturally across column partitions without clipping.', heightClass: 'h-64', tag: '02 // CASCADE' },
  { id: '03', title: 'Break-Inside Isolation', desc: 'Native CSS fragmentation protection preventing boundary fracture.', heightClass: 'h-40', tag: '03 // ISOLATION' },
  { id: '04', title: 'Sequential Auto Waterfall', desc: 'Height-bounded deterministic layout filling columns in priority sequence.', heightClass: 'h-72', tag: '04 // WATERFALL' },
  { id: '05', title: 'Adaptive Breakpoints', desc: 'Container-aware column scaling spanning mobile (1 col) to ultra-wide (4+ cols).', heightClass: 'h-52', tag: '05 // ADAPTIVE' },
  { id: '06', title: 'Memory-Safe Lifecycle', desc: 'Stateless declarative container with zero persistent listeners.', heightClass: 'h-44', tag: '06 // ZERO-LEAK' },
  { id: '07', title: 'Universal Compilation', desc: 'Single unified layout engine compiled for all 13 supported ecosystems.', heightClass: 'h-60', tag: '07 // CROSS-PLATFORM' },
  { id: '08', title: 'Sub-Millisecond V-Sync', desc: 'Zero JavaScript execution during scroll, guaranteeing 120 FPS render.', heightClass: 'h-48', tag: '08 // V-SYNC' },
];

export function CssMasonryDemo() {
  return (
    <section className="p-8 bg-background text-foreground">
      <CssMasonry
        columns={1}
        columnsSm={2}
        columnsMd={2}
        columnsLg={3}
        columnsXl={4}
        gap={16}
        columnFill="balance"
        className="max-w-6xl mx-auto"
      >
        {TILES.map((tile) => (
          <div
            key={tile.id}
            className={`${tile.heightClass} rounded-2xl border border-border/80 bg-card p-6 shadow-xs flex flex-col justify-between`}
          >
            <div>
              <span className="text-3xs font-mono font-bold text-primary">{tile.tag}</span>
              <h3 className="font-bold text-base mt-2">{tile.title}</h3>
              <p className="text-muted-foreground text-xs mt-2">{tile.desc}</p>
            </div>
            <div className="pt-3 border-t border-border/40 flex justify-between text-3xs font-mono text-muted-foreground">
              <span>TILE #{tile.id}</span>
              <span className="text-emerald-400 font-bold">120 FPS</span>
            </div>
          </div>
        ))}
      </CssMasonry>
    </section>
  );
}
// 03·API Contract

Props & Configuration

Exhaustive parameter contract for CSS Masonry. Validated in the live Studio workbench above and statically checked across all 13 ecosystem templates.

PropTypeDefaultDescription
columns
number1Base column count on mobile viewports (<640px).
columnsSm
number2Number of columns on tablet viewports (≥640px).
columnsMd
number2Number of columns on medium tablet viewports.
columnsLg
number3Number of columns on desktop viewports.
columnsXl
number4Number of columns on large screens (≥1280px).
gap
number16Spacing between masonry columns and item margins.
columnFill
selectbalanceControls whether column heights are balanced or filled sequentially.
height
number0Explicit container height for sequential waterfall (0 for auto balance).
columns
number

Base column count on mobile viewports (<640px).

Default:1
columnsSm
number

Number of columns on tablet viewports (≥640px).

Default:2
columnsMd
number

Number of columns on medium tablet viewports.

Default:2
columnsLg
number

Number of columns on desktop viewports.

Default:3
columnsXl
number

Number of columns on large screens (≥1280px).

Default:4
gap
number

Spacing between masonry columns and item margins.

Default:16
columnFill
select

Controls whether column heights are balanced or filled sequentially.

Default:balance
height
number

Explicit container height for sequential waterfall (0 for auto balance).

Default:0
// 04·Source Code

Component Source

Component source definition for React (.tsx). Toggle between the clean wrapper and the standalone ejected engine micro-kernel.

+
+
CssMasonry.tsx
import * as React from 'react';
import * as CssMasonryPrimitive from '@exhuma/core';
import { clsx } from 'clsx';

export interface CssMasonryProps extends React.ComponentPropsWithoutRef<typeof CssMasonryPrimitive.CssMasonry> {
  className?: string;
}

export const CssMasonry = React.forwardRef<HTMLDivElement, CssMasonryProps>(
  ({ className, children, ...props }, ref) => (
    <CssMasonryPrimitive.CssMasonry
      ref={ref}
      className={clsx(
        'columns-1 sm:columns-2 md:columns-3 gap-4 [column-fill:_balance] w-full space-y-4',
        className
      )}
      {...props}
    >
      {children}
    </CssMasonryPrimitive.CssMasonry>
  )
);
CssMasonry.displayName = 'CssMasonry';

export const CssMasonryItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
  ({ className, children, ...props }, ref) => (
    <CssMasonryPrimitive.CssMasonryItem
      ref={ref}
      className={clsx('', className)}
      {...props}
    >
      {children}
    </CssMasonryPrimitive.CssMasonryItem>
  )
);
CssMasonryItem.displayName = 'CssMasonryItem';
// 05·Architecture

Lifecycle Safety & Performance

Engineered for high-frequency user interactions with zero memory leaks.

Teardown

Deterministic Cleanup

All pointer event listeners, scroll handlers, and resize observers are cleanly destroyed on component unmount, preventing lingering background processes.
Compositor

GPU Compositor Acceleration

Transform and opacity modifications run directly on the GPU compositor thread using will-change: transform without triggering browser layout recalculations.
// 06·a11y

Accessibility Considerations

Fully compliant with WCAG guidelines and respects user motion preferences.

Motion

prefers-reduced-motion Support

When a user has prefers-reduced-motion: reduce enabled in their operating system, Exhuma components automatically disable 3D gyroscope tilt and spring animations, rendering static accessible content.
Expandable CardRow Masonry