You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MiniMasonry is a **lightweight** dependency free Masonry layout. It will compute elements position in JavaScript and update their positions using CSS's **transform attribute**. This means positioning does not trigger browser layout and **use** the device's **GPU**. This also allows CSS animation during element positioning.
8
8
9
-
MiniMasonry is **responsive**, you give it a target width and it will adjust columns number and elements width. MiniMasonry will increase element width (until another column can fit in the layout) but will never reduce the target width.
9
+
MiniMasonry is **responsive** by default, you give it a target width and it will adjust columns number and elements width. MiniMasonry will increase element width (until another column can fit in the layout) but will never reduce the target width.
10
10
11
11
## Installation
12
12
@@ -27,7 +27,7 @@ import MiniMasonry from "minimasonry";
27
27
28
28
## Usage
29
29
30
-
To use MiniMasonry you should have a container **relatively positioned** with your elements as children. Those **children** elements must be **absolutely positioned**.
30
+
⚠️ To use MiniMasonry you should have a container **relatively positioned** with your elements as children. Those **children** elements must be **absolutely positioned**.
31
31
32
32
Then you can initialise MiniMasonry :
33
33
@@ -52,6 +52,7 @@ surroundingGutter (boolean)|true|Set left gutter on first columns and right gutt
52
52
ultimateGutter (int)|5|Gutter applied when only 1 column can be displayed.
53
53
direction (string)|"ltr"|Sorting direction, "ltr" or "rtl".
54
54
wedge (boolean)|false|False will start to sort from center, true will start from left or right according to direction parameter.
55
+
responsive (boolean)|true|True will add a "resize" event listener on the window to redraw the masonry on window resize. This listener is throttled to 66ms (15fps).
55
56
56
57
## API
57
58
@@ -60,9 +61,7 @@ Here is the list of available APIs :
60
61
Name|Description
61
62
----|-----------
62
63
layout()|If list has changed, trigger a relayout of the masonry.
63
-
destroy()|Remove the resize listener and set back container as it was before initialization.
64
-
65
-
MiniMasonry will add a "resize" event listener on the window to redraw the masonry on window resize. This listener is throttled to 66ms (15fps).
64
+
destroy()|Remove the resize listener if any and set back container as it was before initialization.
0 commit comments