Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-masonry>

@methane-ui/ui~7.9 KB brotli (cold + Lit)~2.0 KB marginal

Responsive multi-column masonry grid adapting column count dynamically via ObserverPoolController.

When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-masonry> (@methane-ui/ui)
TokensOKLCH color ramps & semantic aliases.PrimitivesShared FormControl, Listbox, Overlay, Positioning, and Virtualizer controllers.SSR AdaptersNext.js, Nuxt, Astro, SvelteKit, and Angular Declarative Shadow DOM renderers.ConformanceVitest + Playwright Chromium & WebKit suites.
Ready · interact with <mth-masonry>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/masonry"></script>
<mth-masonry columns="0" min-column-width="240">Example</mth-masonry>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
columnscolumnsnumber0Explicit column count (0 computes columns automatically from container inline size and minColumnWidth).
minColumnWidthmin-column-widthnumber240Minimum column width in pixels used when columns is 0.
gapgapstring"1rem"CSS length between columns and stacked items.

Events

EventDetail TypeDescription
mth-layout{ columns: number }Fired when the resolved column count changes.

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="none".lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix