react-motion-gallery 2.0.76 → 2.0.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -42
- package/dist/{FullscreenRuntime-YUCNZSE6.mjs → FullscreenRuntime-GNSZ2OS3.mjs} +1 -1
- package/dist/FullscreenRuntime-OE6CYK62.css +1 -0
- package/dist/{GridSkeleton-BmMxvXie.d.mts → GridSkeleton-DHuqcIFL.d.mts} +1 -1
- package/dist/{MasonrySkeleton-Dju7PDw7.d.mts → MasonrySkeleton-C7WkAbFh.d.mts} +1 -1
- package/dist/chunk-2WM2A4RK.mjs +4 -0
- package/dist/chunk-2YTRLSWQ.mjs +1 -0
- package/dist/chunk-3GLW5FCD.mjs +1 -0
- package/dist/{chunk-4QZCHWR5.mjs → chunk-3TFKVS63.mjs} +1 -1
- package/dist/{chunk-536MNOJH.mjs → chunk-5OYXAAEQ.mjs} +1 -1
- package/dist/chunk-6BPMRW6K.mjs +1 -0
- package/dist/{chunk-CIETZWGT.mjs → chunk-6G2EJHW6.mjs} +1 -1
- package/dist/{chunk-WE3JOHED.mjs → chunk-6MX5FBOB.mjs} +1 -1
- package/dist/{chunk-VJPQSYY6.mjs → chunk-7CUGPJMX.mjs} +1 -1
- package/dist/{chunk-E52DTULL.mjs → chunk-7G5QBCV3.mjs} +1 -1
- package/dist/chunk-A5ERE5BW.mjs +3 -0
- package/dist/{chunk-AJHLDKVD.mjs → chunk-B3L6FFUP.mjs} +1 -1
- package/dist/{chunk-S72WUSQL.mjs → chunk-F443J6CZ.mjs} +1 -1
- package/dist/chunk-GVW2FBCS.mjs +1 -0
- package/dist/{chunk-ZE6FIVKA.mjs → chunk-HNMR7ZQY.mjs} +1 -1
- package/dist/{chunk-SOWWUXCL.mjs → chunk-IFU7FJFX.mjs} +1 -1
- package/dist/chunk-IGSEIMAQ.mjs +1 -0
- package/dist/chunk-JHKY7OB7.mjs +0 -0
- package/dist/{chunk-M32PXYQO.mjs → chunk-JYIGG2JK.mjs} +1 -1
- package/dist/chunk-KOI77DGH.mjs +1 -0
- package/dist/chunk-MUYJLDYM.mjs +1 -0
- package/dist/{chunk-AIFIRFXZ.mjs → chunk-PAX6EZMX.mjs} +1 -1
- package/dist/chunk-QUY5FE75.mjs +1 -0
- package/dist/chunk-S23S23HP.mjs +2 -0
- package/dist/chunk-SMR2CHXT.mjs +1 -0
- package/dist/{chunk-Q7CX2MQ5.mjs → chunk-UBCYWKG3.mjs} +1 -1
- package/dist/{chunk-26PS4IG4.mjs → chunk-Y33KEQVI.mjs} +1 -1
- package/dist/{chunk-XEHEQE3K.mjs → chunk-YTIARAWT.mjs} +1 -1
- package/dist/chunk-ZVFKCJM2.mjs +1 -0
- package/dist/entries-cache.css +1 -1
- package/dist/entries-cache.d.mts +5 -5
- package/dist/entries-cache.mjs +1 -1
- package/dist/entries.css +1 -1
- package/dist/entries.d.mts +5 -5
- package/dist/entries.mjs +1 -1
- package/dist/fullscreen-captions.css +1 -1
- package/dist/fullscreen-captions.mjs +1 -1
- package/dist/fullscreen-lazy-load.css +1 -1
- package/dist/fullscreen-lazy-load.mjs +1 -1
- package/dist/fullscreen-slider.css +1 -1
- package/dist/fullscreen-slider.mjs +1 -1
- package/dist/fullscreen-video.css +1 -1
- package/dist/fullscreen-video.mjs +1 -1
- package/dist/fullscreen.css +1 -1
- package/dist/fullscreen.mjs +1 -1
- package/dist/fullscreenThumbnails.css +1 -1
- package/dist/fullscreenThumbnails.mjs +1 -1
- package/dist/grid-fullscreen.d.mts +12 -0
- package/dist/grid-fullscreen.mjs +1 -0
- package/dist/grid-lazy-load.css +1 -1
- package/dist/grid-lazy-load.d.mts +1 -1
- package/dist/grid-lazy-load.mjs +1 -1
- package/dist/grid-ready.d.mts +1 -1
- package/dist/grid.css +1 -1
- package/dist/grid.d.mts +3 -3
- package/dist/grid.mjs +1 -1
- package/dist/{index-Dop14JX0.d.mts → index-k9JcWxFa.d.mts} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.mts +6 -4
- package/dist/index.mjs +1 -1
- package/dist/masonry-BHq_xi-F.d.mts +76 -0
- package/dist/{masonry-Bapgkuum.d.mts → masonry-C7eQ6whX.d.mts} +4 -4
- package/dist/masonry-fullscreen.d.mts +10 -0
- package/dist/masonry-fullscreen.mjs +1 -0
- package/dist/masonry-lazy-load.css +1 -1
- package/dist/masonry-lazy-load.d.mts +5 -3
- package/dist/masonry-lazy-load.mjs +1 -1
- package/dist/masonry-measured-ready.d.mts +4 -0
- package/dist/masonry-measured-ready.mjs +1 -0
- package/dist/masonry-measured.css +1 -0
- package/dist/masonry-measured.d.mts +21 -0
- package/dist/masonry-measured.mjs +1 -0
- package/dist/masonry-ready.d.mts +1 -1
- package/dist/masonry.css +1 -1
- package/dist/masonry.d.mts +48 -11
- package/dist/masonry.mjs +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/placement-BWKxkHD8.d.mts +5 -0
- package/dist/skeleton-base.css +1 -1
- package/dist/skeleton-base.mjs +1 -1
- package/dist/skeleton-cache-base.css +1 -1
- package/dist/skeleton-cache-base.mjs +1 -1
- package/dist/skeleton-cache-grid.css +1 -1
- package/dist/skeleton-cache-grid.d.mts +2 -2
- package/dist/skeleton-cache-grid.mjs +1 -1
- package/dist/skeleton-cache-masonry-structured.css +1 -0
- package/dist/skeleton-cache-masonry-structured.d.mts +20 -0
- package/dist/skeleton-cache-masonry-structured.mjs +1 -0
- package/dist/skeleton-cache-masonry.css +1 -1
- package/dist/skeleton-cache-masonry.d.mts +4 -10
- package/dist/skeleton-cache-masonry.mjs +1 -1
- package/dist/skeleton-cache-slider.css +1 -1
- package/dist/skeleton-cache-slider.mjs +1 -1
- package/dist/skeleton-grid.css +1 -1
- package/dist/skeleton-grid.d.mts +3 -3
- package/dist/skeleton-grid.mjs +1 -1
- package/dist/skeleton-masonry-structured.css +1 -0
- package/dist/skeleton-masonry-structured.d.mts +62 -0
- package/dist/skeleton-masonry-structured.mjs +1 -0
- package/dist/skeleton-masonry.css +1 -1
- package/dist/skeleton-masonry.d.mts +8 -60
- package/dist/skeleton-masonry.mjs +1 -1
- package/dist/skeleton-slider-restore.css +1 -1
- package/dist/skeleton-slider-restore.mjs +1 -1
- package/dist/skeleton-slider.css +1 -1
- package/dist/skeleton-slider.mjs +1 -1
- package/dist/slider-dots.css +1 -1
- package/dist/slider-dots.mjs +1 -1
- package/dist/slider-lazy-load.css +1 -1
- package/dist/slider-lazy-load.mjs +1 -1
- package/dist/slider-loading.css +1 -1
- package/dist/slider-loading.mjs +1 -1
- package/dist/slider-scrollbar.css +1 -1
- package/dist/slider-scrollbar.mjs +1 -1
- package/dist/slider.css +1 -1
- package/dist/slider.mjs +1 -1
- package/dist/styles.css +7 -3
- package/dist/thumbnails.css +1 -1
- package/dist/thumbnails.mjs +1 -1
- package/dist/types-0ntfoMKP.d.mts +35 -0
- package/dist/{types-ap0Mfoo0.d.mts → types-CYB4fl6-.d.mts} +16 -4
- package/dist/{types-plwyER1z.d.mts → types-Cc37Drgz.d.mts} +2 -1
- package/dist/video.css +1 -1
- package/dist/video.mjs +1 -1
- package/dist/zoomPan.mjs +1 -1
- package/package.json +25 -1
- package/dist/FullscreenRuntime-N57MGEC6.css +0 -1
- package/dist/chunk-5BPPBSSK.mjs +0 -3
- package/dist/chunk-DJFTY42G.mjs +0 -1
- package/dist/chunk-ESPDSNI6.mjs +0 -1
- package/dist/chunk-I3HJIUHX.mjs +0 -1
- package/dist/chunk-JB7UY72X.mjs +0 -1
- package/dist/chunk-OI76LZVE.mjs +0 -1
- package/dist/chunk-QBGBTFT4.mjs +0 -2
- package/dist/chunk-TOYDNDZ6.mjs +0 -4
- package/dist/chunk-WS5Y5APY.mjs +0 -1
- package/dist/chunk-YOOKXYP6.mjs +0 -1
package/README.md
CHANGED
|
@@ -11,15 +11,19 @@ This table reports local gzip measurements for selected runtime surfaces. Type-o
|
|
|
11
11
|
<!-- bundle-size:start -->
|
|
12
12
|
| Surface | JS gzip |
|
|
13
13
|
| --- | --- |
|
|
14
|
-
| `Entries` | 12.
|
|
15
|
-
| `entries/cache` |
|
|
14
|
+
| `Entries` | 12.3kB |
|
|
15
|
+
| `entries/cache` | 17.0kB |
|
|
16
16
|
| `FullscreenThumbnailSlider` | 20.3kB |
|
|
17
17
|
| `GalleryCore` | 2.6kB |
|
|
18
|
-
| `Grid` |
|
|
18
|
+
| `Grid` | 5.4kB |
|
|
19
19
|
| `grid/ready` | 323.0B |
|
|
20
20
|
| `grid/lazy-load` | 3.3kB |
|
|
21
|
-
| `
|
|
21
|
+
| `grid/fullscreen` | 1.6kB |
|
|
22
|
+
| `Masonry` | 4.2kB |
|
|
22
23
|
| `masonry/ready` | 323.0B |
|
|
24
|
+
| `masonry/fullscreen` | 1.1kB |
|
|
25
|
+
| `masonry/measured` | 7.2kB |
|
|
26
|
+
| `masonry/measured/ready` | 323.0B |
|
|
23
27
|
| `masonry/lazy-load` | 3.3kB |
|
|
24
28
|
| `Skeleton base` | 8.9kB |
|
|
25
29
|
| `skeleton/cache/base` | 13.6kB |
|
|
@@ -28,8 +32,10 @@ This table reports local gzip measurements for selected runtime surfaces. Type-o
|
|
|
28
32
|
| `skeleton/slider/restore` | 25.2kB |
|
|
29
33
|
| `skeleton/grid` | 11.2kB |
|
|
30
34
|
| `skeleton/cache/grid` | 16.0kB |
|
|
31
|
-
| `skeleton/masonry` |
|
|
32
|
-
| `skeleton/cache/masonry` |
|
|
35
|
+
| `skeleton/masonry` | 4.4kB |
|
|
36
|
+
| `skeleton/cache/masonry` | 4.4kB |
|
|
37
|
+
| `skeleton/masonry/structured` | 20.2kB |
|
|
38
|
+
| `skeleton/cache/masonry/structured` | 25.3kB |
|
|
33
39
|
| `Slider core` | 19.0kB |
|
|
34
40
|
| `slider/ready` | 894.0B |
|
|
35
41
|
| `slider/arrows` | 1.2kB |
|
|
@@ -49,11 +55,11 @@ This table reports local gzip measurements for selected runtime surfaces. Type-o
|
|
|
49
55
|
| `fullscreen/controls` | 173.0B |
|
|
50
56
|
| `fullscreen/captions` | 13.2kB |
|
|
51
57
|
| `fullscreen/zoom-pan` | 12.4kB |
|
|
52
|
-
| `fullscreen/video` | 16.
|
|
58
|
+
| `fullscreen/video` | 16.5kB |
|
|
53
59
|
| `fullscreen/lazy-load` | 13.2kB |
|
|
54
60
|
| `fullscreen/crossfade` | 181.0B |
|
|
55
61
|
| `fullscreen/thumbnails` | 160.0B |
|
|
56
|
-
| `Video` | 12.
|
|
62
|
+
| `Video` | 12.8kB |
|
|
57
63
|
| `ZoomPanImage` | 11.0kB |
|
|
58
64
|
| `zoomPan/hover` | 124.0B |
|
|
59
65
|
| `media / toMediaItems` | 260.0B |
|
|
@@ -171,21 +177,27 @@ Subpaths give bundlers a smaller graph than the root. Less JS to transfer, parse
|
|
|
171
177
|
| `react-motion-gallery/grid` | `Grid`, `Grid.Item`, grid types |
|
|
172
178
|
| `react-motion-gallery/grid/ready` | `useGridReady` |
|
|
173
179
|
| `react-motion-gallery/grid/lazy-load` | `gridLazyLoad` |
|
|
180
|
+
| `react-motion-gallery/grid/fullscreen` | `gridFullscreen` for Grid + `GalleryCore` |
|
|
174
181
|
| `react-motion-gallery/masonry` | `Masonry`, `Masonry.Item`, masonry types |
|
|
175
182
|
| `react-motion-gallery/masonry/ready` | `useMasonryReady` |
|
|
183
|
+
| `react-motion-gallery/masonry/fullscreen` | `masonryFullscreen` for light Masonry + `GalleryCore` |
|
|
184
|
+
| `react-motion-gallery/masonry/measured` | Measured `Masonry`, `Masonry.Item`, plugins/reveal/fullscreen types |
|
|
185
|
+
| `react-motion-gallery/masonry/measured/ready` | `useMasonryReady` for measured masonry |
|
|
176
186
|
| `react-motion-gallery/masonry/lazy-load` | `masonryLazyLoad` |
|
|
177
187
|
| `react-motion-gallery/entries` | `Entries`, `flattenEntries`, entry media container helpers |
|
|
178
188
|
| `react-motion-gallery/entries/cache` | `CachedEntries` with `entries.loading.cache` |
|
|
179
189
|
| `react-motion-gallery/skeleton/base` | Standalone `Skeleton` and generic skeleton authoring types |
|
|
180
190
|
| `react-motion-gallery/skeleton/slider` | `SliderSkeleton` and slider skeleton authoring types |
|
|
181
191
|
| `react-motion-gallery/skeleton/grid` | `GridSkeleton` and grid skeleton authoring types |
|
|
182
|
-
| `react-motion-gallery/skeleton/masonry` | `MasonrySkeleton`
|
|
192
|
+
| `react-motion-gallery/skeleton/masonry` | Lightweight `MasonrySkeleton` for dimensioned placeholders |
|
|
193
|
+
| `react-motion-gallery/skeleton/masonry/structured` | Structured `MasonrySkeleton` and masonry skeleton authoring types |
|
|
183
194
|
| `react-motion-gallery/skeleton/cache` | Server-safe skeleton cookie cache helpers and types |
|
|
184
195
|
| `react-motion-gallery/skeleton/cache/provider` | Client `SkeletonCacheProvider` for SSR snapshots and client cookie refresh |
|
|
185
196
|
| `react-motion-gallery/skeleton/cache/base` | `CachedSkeleton` with `cache` |
|
|
186
197
|
| `react-motion-gallery/skeleton/cache/slider` | `CachedSliderSkeleton` with `cache` |
|
|
187
198
|
| `react-motion-gallery/skeleton/cache/grid` | `CachedGridSkeleton` with `cache` |
|
|
188
|
-
| `react-motion-gallery/skeleton/cache/masonry` | `CachedMasonrySkeleton`
|
|
199
|
+
| `react-motion-gallery/skeleton/cache/masonry` | Lightweight `CachedMasonrySkeleton` |
|
|
200
|
+
| `react-motion-gallery/skeleton/cache/masonry/structured` | Structured `CachedMasonrySkeleton` with `cache` |
|
|
189
201
|
| `react-motion-gallery/skeleton/slider/restore` | `RestoredSliderSkeleton` with `restore` and optional `cache` |
|
|
190
202
|
| `react-motion-gallery/fullscreen` | `useFullscreenController` and fullscreen types |
|
|
191
203
|
| `react-motion-gallery/fullscreen/slider` | `fullscreenSlider` |
|
|
@@ -555,9 +567,9 @@ Wrap the client tree in `SkeletonCacheProvider`, then opt individual skeletons i
|
|
|
555
567
|
|
|
556
568
|
import type { SkeletonCacheSnapshot } from "react-motion-gallery/skeleton/cache";
|
|
557
569
|
import { SkeletonCacheProvider } from "react-motion-gallery/skeleton/cache/provider";
|
|
558
|
-
import { CachedMasonrySkeleton as MasonrySkeleton } from "react-motion-gallery/skeleton/cache/masonry";
|
|
559
|
-
import { Masonry } from "react-motion-gallery/masonry";
|
|
560
|
-
import { useMasonryReady } from "react-motion-gallery/masonry/ready";
|
|
570
|
+
import { CachedMasonrySkeleton as MasonrySkeleton } from "react-motion-gallery/skeleton/cache/masonry/structured";
|
|
571
|
+
import { Masonry } from "react-motion-gallery/masonry/measured";
|
|
572
|
+
import { useMasonryReady } from "react-motion-gallery/masonry/measured/ready";
|
|
561
573
|
|
|
562
574
|
export function GalleryPageClient({
|
|
563
575
|
skeletonCacheSnapshots,
|
|
@@ -1315,8 +1327,8 @@ export function BasicGrid() {
|
|
|
1315
1327
|
| `gap` | `number \| Record<string, number>` | `8` | Responsive grid gap. |
|
|
1316
1328
|
| `rootClassName` | `string` | `—` | Class name for the grid root. |
|
|
1317
1329
|
| `itemClassName` | `string` | `—` | Class name added to each wrapped grid item. |
|
|
1318
|
-
| `fullscreenTrigger` | `"item" \| "media"` | `"media"` |
|
|
1319
|
-
| `plugins` | `GridPlugin[]` | `[]` | Explicit first-party Grid features such as lazy-load. |
|
|
1330
|
+
| `fullscreenTrigger` | `"item" \| "media"` | `"media"` | When `gridFullscreen()` is active, opens fullscreen from the clicked media node or the entire item shell. |
|
|
1331
|
+
| `plugins` | `GridPlugin[]` | `[]` | Explicit first-party Grid features such as lazy-load and fullscreen. |
|
|
1320
1332
|
| `reveal.renderReveal` | `({ active, containerProps }, content) => ReactNode` | `—` | Custom reveal wrapper. |
|
|
1321
1333
|
| `reveal.staggerMs` | `number` | `60` | Reveal stagger for the fade-in. |
|
|
1322
1334
|
| `reveal.durationMs` | `number` | `600` | Reveal fade duration. |
|
|
@@ -1330,17 +1342,19 @@ Import Grid plugins from their own subpaths and pass them to `plugins`.
|
|
|
1330
1342
|
```typescript
|
|
1331
1343
|
import { Grid } from "react-motion-gallery/grid";
|
|
1332
1344
|
import { gridLazyLoad } from "react-motion-gallery/grid/lazy-load";
|
|
1345
|
+
import { gridFullscreen } from "react-motion-gallery/grid/fullscreen";
|
|
1333
1346
|
|
|
1334
|
-
<Grid plugins={[gridLazyLoad({ spinner: true })]}>{items}</Grid>;
|
|
1347
|
+
<Grid plugins={[gridLazyLoad({ spinner: true }), gridFullscreen()]}>{items}</Grid>;
|
|
1335
1348
|
```
|
|
1336
1349
|
|
|
1337
1350
|
| Import | Factory | Notes |
|
|
1338
1351
|
| --- | --- | --- |
|
|
1339
1352
|
| `react-motion-gallery/grid/lazy-load` | `gridLazyLoad(options)` | Rewrites trackable image `src` values into `data-rmg-lazy-src`, reveals them on viewport intersection, then fades them in after decode and spinner exit. |
|
|
1353
|
+
| `react-motion-gallery/grid/fullscreen` | `gridFullscreen()` | Opens `GalleryCore` fullscreen from Grid items without adding fullscreen code to the default grid import. |
|
|
1340
1354
|
|
|
1341
1355
|
`gridLazyLoad()` enables lazy loading by default. Pass `{ enabled: false }` to make the plugin inert.
|
|
1342
1356
|
|
|
1343
|
-
Grid fullscreen behavior is provided by `GalleryCore` and `
|
|
1357
|
+
Grid fullscreen behavior is provided by `GalleryCore`, `useFullscreenController`, and the opt-in `gridFullscreen()` plugin. Grid itself does not expose a ref-based imperative API.
|
|
1344
1358
|
|
|
1345
1359
|
Wrap a card in `Grid.Item` when it should span tracks or needs wrapper styling:
|
|
1346
1360
|
|
|
@@ -1434,18 +1448,29 @@ function GridWithSkeleton({ images }: { images: { src: string; alt: string }[] }
|
|
|
1434
1448
|
```typescript
|
|
1435
1449
|
import { Masonry } from "react-motion-gallery";
|
|
1436
1450
|
|
|
1437
|
-
const
|
|
1451
|
+
const images = [
|
|
1452
|
+
{ src: "https://picsum.photos/id/1018/1200/1600", width: 1200, height: 1600 },
|
|
1453
|
+
{ src: "https://picsum.photos/id/1025/1200/900", width: 1200, height: 900 },
|
|
1454
|
+
{ src: "https://picsum.photos/id/1036/1200/1500", width: 1200, height: 1500, span: { 0: 1, 1100: 2 } },
|
|
1455
|
+
{ src: "https://picsum.photos/id/1041/1200/800", width: 1200, height: 800 },
|
|
1456
|
+
];
|
|
1438
1457
|
|
|
1439
1458
|
export function BasicMasonry() {
|
|
1440
1459
|
return (
|
|
1441
1460
|
<Masonry columns={{ 0: 1, 700: 2, 1100: 3 }} gap={{ 0: 12, 1100: 20 }}>
|
|
1442
|
-
{
|
|
1443
|
-
<
|
|
1444
|
-
key={
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1461
|
+
{images.map((image, index) => (
|
|
1462
|
+
<Masonry.Item
|
|
1463
|
+
key={image.src}
|
|
1464
|
+
width={image.width}
|
|
1465
|
+
height={image.height}
|
|
1466
|
+
span={image.span}
|
|
1467
|
+
>
|
|
1468
|
+
<img
|
|
1469
|
+
src={image.src}
|
|
1470
|
+
alt={`Masonry item ${index + 1}`}
|
|
1471
|
+
style={{ width: "100%", height: "100%", objectFit: "cover", borderRadius: 12 }}
|
|
1472
|
+
/>
|
|
1473
|
+
</Masonry.Item>
|
|
1449
1474
|
))}
|
|
1450
1475
|
</Masonry>
|
|
1451
1476
|
);
|
|
@@ -1456,7 +1481,7 @@ export function BasicMasonry() {
|
|
|
1456
1481
|
|
|
1457
1482
|
| Option | Type | Default | Notes |
|
|
1458
1483
|
| --- | --- | --- | --- |
|
|
1459
|
-
| `children` | `React.ReactNode` | `—` |
|
|
1484
|
+
| `children` | `React.ReactNode` | `—` | Dimensioned masonry items. Each item should be wrapped in `Masonry.Item`. |
|
|
1460
1485
|
| `breakpoints` | `Record<string, number>` | `xs: 0, sm: 600, md: 900, lg: 1200, xl: 1536` | Used to resolve responsive columns and gaps. |
|
|
1461
1486
|
|
|
1462
1487
|
### Masonry.Item props
|
|
@@ -1464,6 +1489,8 @@ export function BasicMasonry() {
|
|
|
1464
1489
|
| Option | Type | Default | Notes |
|
|
1465
1490
|
| --- | --- | --- | --- |
|
|
1466
1491
|
| `children` | `React.ReactNode` | `—` | The masonry card content. |
|
|
1492
|
+
| `width` | `number` | `—` | Intrinsic item width used for aspect-ratio layout. |
|
|
1493
|
+
| `height` | `number` | `—` | Intrinsic item height used for aspect-ratio layout. |
|
|
1467
1494
|
| `span` | `number \| "full" \| Record<string, number \| "full">` | `1` | Per-item track span. `"full"` resolves to the active column count and numeric values clamp to the current track count. |
|
|
1468
1495
|
| `className` | `string` | `—` | Extra class name merged onto the masonry item wrapper. |
|
|
1469
1496
|
| `style` | `React.CSSProperties` | `—` | Inline styles merged onto the masonry item wrapper. |
|
|
@@ -1475,41 +1502,41 @@ export function BasicMasonry() {
|
|
|
1475
1502
|
| `columns` | `number \| Record<string, number>` | `—` | Responsive column count. |
|
|
1476
1503
|
| `gap` | `number \| Record<string, number>` | `—` | Responsive gap between columns and items. |
|
|
1477
1504
|
| `placement` | `"balanced" \| "roundRobin" \| "horizontalOrder"` | `"balanced"` | `balanced` packs into the shortest fitting column group, `roundRobin` cycles start columns deterministically, and `horizontalOrder` preserves a stronger left-to-right scan when spans are involved. |
|
|
1478
|
-
| `fullscreenTrigger` | `"item" \| "media"` | `"media"` | Opens fullscreen from the clicked media node or the entire masonry item shell. |
|
|
1479
|
-
| `itemWrapClassName` | `string` | `—` | Class name added to the masonry item wrapper. |
|
|
1480
|
-
| `itemWrapStyle` | `React.CSSProperties` | `—` | Inline styles applied to the masonry item wrapper. |
|
|
1481
1505
|
| `as` | `React.ElementType` | `"div"` | Root HTML element or custom component. |
|
|
1482
1506
|
| `rootRef` | `React.Ref<HTMLDivElement>` | `—` | Ref to the masonry root. |
|
|
1483
1507
|
| `classNames.root` | `string` | `—` | Root class name. |
|
|
1484
|
-
| `classNames.column` | `string` | `—` | Retained for backwards compatibility with the legacy column-wrapper renderer. |
|
|
1485
1508
|
| `classNames.item` | `string` | `—` | Item class name. |
|
|
1486
|
-
| `plugins` | `MasonryPlugin[]` | `[]` |
|
|
1487
|
-
| `reveal.renderReveal` | `({ active, containerProps }, content) => ReactNode` | `—` | Custom reveal wrapper. |
|
|
1509
|
+
| `plugins` | `MasonryPlugin[]` | `[]` | Opt-in light Masonry plugins, currently `masonryFullscreen()` from `react-motion-gallery/masonry/fullscreen`. |
|
|
1488
1510
|
| `reveal.staggerMs` | `number` | `160` | Reveal stagger for the fade-in. |
|
|
1489
1511
|
| `reveal.durationMs` | `number` | `600` | Reveal fade duration. |
|
|
1490
1512
|
| `reveal.easing` | `string` | `"cubic-bezier(.2,.7,.2,1)"` | Reveal fade easing. |
|
|
1491
|
-
| `reveal.
|
|
1513
|
+
| `reveal.disabled` | `boolean` | `false` | Disables the built-in reveal classes. |
|
|
1514
|
+
| `revealReady` | `boolean` | `true` | Holds the reveal until external loading or viewport orchestration is ready. |
|
|
1492
1515
|
|
|
1493
1516
|
### Masonry plugins
|
|
1494
1517
|
|
|
1495
|
-
Import Masonry plugins from their own subpaths and pass them to `plugins`.
|
|
1518
|
+
Import Masonry plugins from their own subpaths and pass them to `plugins`. The default dimensioned core supports the fullscreen bridge through an opt-in subpath.
|
|
1496
1519
|
|
|
1497
1520
|
```typescript
|
|
1521
|
+
import { GalleryCore } from "react-motion-gallery/core";
|
|
1498
1522
|
import { Masonry } from "react-motion-gallery/masonry";
|
|
1499
|
-
import {
|
|
1523
|
+
import { masonryFullscreen } from "react-motion-gallery/masonry/fullscreen";
|
|
1500
1524
|
|
|
1501
|
-
<
|
|
1525
|
+
<GalleryCore layout="masonry" fullscreenItems={items}>
|
|
1526
|
+
<Masonry plugins={[masonryFullscreen()]}>{children}</Masonry>
|
|
1527
|
+
</GalleryCore>;
|
|
1502
1528
|
```
|
|
1503
1529
|
|
|
1504
1530
|
| Import | Factory | Notes |
|
|
1505
1531
|
| --- | --- | --- |
|
|
1532
|
+
| `react-motion-gallery/masonry/fullscreen` | `masonryFullscreen()` | Opens `GalleryCore` fullscreen from light dimensioned Masonry items without adding fullscreen code to the default masonry import. |
|
|
1506
1533
|
| `react-motion-gallery/masonry/lazy-load` | `masonryLazyLoad(options)` | Uses the same image shell behavior as Slider: trackable image `src` values move into `data-rmg-lazy-src`, real images load on intersection, and items fade in after decode and spinner exit. |
|
|
1507
1534
|
|
|
1508
|
-
`masonryLazyLoad()` enables lazy loading by default. Pass `{ enabled: false }` to make the plugin inert.
|
|
1535
|
+
`masonryLazyLoad()` is for measured Masonry and enables lazy loading by default. Pass `{ enabled: false }` to make the plugin inert.
|
|
1509
1536
|
|
|
1510
|
-
Masonry
|
|
1537
|
+
Measured Masonry accepts arbitrary React children, including text-containing JSX. The wrapper props are only for styling the built-in masonry item shell.
|
|
1511
1538
|
|
|
1512
|
-
|
|
1539
|
+
In the measured subpath, wrap a card in `Masonry.Item` when it needs its own span, wrapper `className`, or wrapper `style`:
|
|
1513
1540
|
|
|
1514
1541
|
```typescript
|
|
1515
1542
|
<Masonry
|
|
@@ -1534,18 +1561,23 @@ Choose a placement based on what should feel stable:
|
|
|
1534
1561
|
|
|
1535
1562
|
Masonry no longer owns loading UI. Use `useMasonryReady` and wrap Masonry with `MasonrySkeleton`, the same composition pattern used by Slider and Grid.
|
|
1536
1563
|
|
|
1537
|
-
Masonry
|
|
1564
|
+
The default Masonry import is dimensioned and lightweight, with built-in reveal timing and opt-in fullscreen through `react-motion-gallery/masonry/fullscreen`. For arbitrary measured card heights, measured lazy-load plugins, and structured skeleton text, import from `react-motion-gallery/masonry/measured` and `react-motion-gallery/skeleton/masonry/structured`.
|
|
1565
|
+
|
|
1566
|
+
Lightweight Masonry skeletons live in `react-motion-gallery/skeleton/masonry` and mirror dimensioned `Masonry.Item` data with `items`, `ratios`, or `heightsPx`.
|
|
1567
|
+
|
|
1568
|
+
Structured Masonry skeletons live in `react-motion-gallery/skeleton/masonry/structured` and can use a `layout` spec with the same inner node vocabulary as Grid skeletons, including `text` nodes and `itemWrapStyle`.
|
|
1538
1569
|
|
|
1539
1570
|
Live Masonry content mounts invisibly until the current item set has completed an initial measurement pass. The Skeleton wrapper stays visible during that handoff, so the first revealed layout is based on measured DOM geometry rather than approximate height hints.
|
|
1540
1571
|
|
|
1541
1572
|
`layout.slots` gives Masonry the same per-card override escape hatch that slider skeletons have. Use a slot when one card needs a different placeholder tree, wrapper styling, span, or outer height. `slot.span` can override the corresponding `Masonry.Item` span for the placeholder, `slot.ratio` maps to Masonry's card-height rhythm, and `slot.heightPx` lets you pin a specific shell height when you need an exact placeholder.
|
|
1542
1573
|
|
|
1543
1574
|
```typescript
|
|
1544
|
-
import { Masonry
|
|
1575
|
+
import { Masonry } from "react-motion-gallery/masonry/measured";
|
|
1576
|
+
import { useMasonryReady } from "react-motion-gallery/masonry/measured/ready";
|
|
1545
1577
|
import {
|
|
1546
1578
|
MasonrySkeleton,
|
|
1547
1579
|
type MasonrySkeletonSpec,
|
|
1548
|
-
} from "react-motion-gallery/skeleton/masonry";
|
|
1580
|
+
} from "react-motion-gallery/skeleton/masonry/structured";
|
|
1549
1581
|
|
|
1550
1582
|
const masonrySkeleton: MasonrySkeletonSpec = {
|
|
1551
1583
|
ratios: [118, 126, 102, 146],
|