Masonry
Server ComponentA responsive CSS multi-column masonry layout for cards and images.
Import
import { Masonry } from "@cronus-ui/ui";
npx cronus-ui add masonry
Examples
.cronus
The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.
default.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component MasonryDefault layout:inline style:masonry {
aria-label:"Gallery"
label "Gallery"
text "Alpha"
text "Beta"
text "Gamma"
text "Delta"
}
page "/audit/masonry/default" type:custom {
use MasonryDefault
}
API Reference
Generated from the component's exported types.
MasonryProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
columns | number | MasonryColumns | DEFAULT_COLUMNS | Number of columns, either a fixed count or a responsive map keyed by breakpoint. |
gap | string | "1rem" | CSS length used for both the column gap and the vertical gap between items. |
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |