
Security News
libxml2 Maintainer Ends Embargoed Vulnerability Reports, Citing Unsustainable Burden
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
react-staggered-grid
Advanced tools
This is a react component that positions and arranges your items in a staggered grid
This is a react component that positions and arranges your items in a staggered grid
npm i react-staggered-grid
Here columns will be generated automatically according to fixed width of each item !
import {StaggeredDisplay, StaggeredGrid, StaggeredGridItem, StaggeredItemSpan} from "react-staggered-grid";
<StaggeredGrid
columns={totalColumns} // number of columns
columnWidth={columnWidth} // width of each column
style={{width : "100%"}}
useElementWidth={true} // uses width : 100%
>
{items.map((item, index) => (
<StaggeredGridItem index={index} key={index} spans={item.span}
style={{transition: "transform 0.3s ease"}}>
<div style={{
width: item.width,
height: item.height + "px",
background: "skyblue",
textAlign: "center",
lineHeight: item.height + "px",
margin: "8px"
}}>
Item {index}
</div>
</StaggeredGridItem>
))}
</StaggeredGrid>
This prop adjusts width of each column on the grid
This prop is required if gridWidth
&& columns
props are not being passed
This prop adjusts the number of columns , If you want the columns to be adjusted according to width
, You don't need to pass this prop , just pass columns
and gridWidth
Custom width of the grid
If you pass columns
&& columnWidth
, grid width would be columns
* columnWidth
but if you want to
force use element width , you can pass useElementWidth = true
when using css styled width , this should be true
This should be mostly centered , unless you have a custom gridWidth and you'd like it to translate each item according to the given alignment
just sets the className on the element of the grid
Children of the grid , should be StaggeredGridItem
CSS properties
It limits item span into range (0-total column count) , true by default
Since StaggeredGrid uses translate , it translates items on the page using position : relative
on the parent
Which makes the parent element has zero height when it contains height
this is by default true , which means that when the grid items are positioned , It tracks the total height and sets it later
FAQs
This is a React component that positions and arranges your items in a staggered grid
The npm package react-staggered-grid receives a total of 111 weekly downloads. As such, react-staggered-grid popularity was classified as not popular.
We found that react-staggered-grid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.