DEFAULT_GALLERY_RATIO
Used when an item has no `width`/`height` (or a degenerate one).
packages/ui/src/components/patterns/gallery-layout.ts
@marktiderman/genesis-ui/patternsimport { DEFAULT_GALLERY_RATIO } from "@marktiderman/genesis-ui/patterns";react-docgen-typescript.DEFAULT_GALLERY_RATIO
Used when an item has no `width`/`height` (or a degenerate one).
No declared props.
galleryItemRatio
Width ÷ height of an item, falling back to 4:3.
| Prop | Type | Default | Description |
|---|---|---|---|
| id* | string | — | |
| src* | string | — | |
| alt | string | — | |
| cacheKey | string | — | Native only: caches the picture under this key instead of `src` (`NativeImage`'s `cacheKey`), for signed URLs that rotate. The web grid ignores it. |
| caption | string | — | |
| height | number | — | |
| width | number | — |
justifyRows
Pack `items` into rows of a target `rowHeight`, then scale each row so its tiles exactly fill `containerWidth` (minus `gap` between tiles). Pure: same input, same rows. Greedy, as in the classic justified-gallery algorithm: tiles are added at the target height until the row would overflow; the row is then closed at whichever of "with" / "without" the overflowing tile is nearer the target width, and scaled to fit. The last row is scaled too, but never above the target height (a single landscape photo in the last row should not fill the width as a banner); it is left-aligned at the target height instead. `containerWidth <= 0` (not measured yet) yields no rows, so callers render nothing rather than divide by zero.
No declared props.