
Security News
Suno Breached via Shai-Hulud Worm, Leaked Code Exposes AI Music Scraping
A Shai-Hulud infection exposed Suno's source code, which shows the AI music startup stream-ripped tracks to train its models.
react-masonry-component3
Advanced tools
npm i react-masonry-component2
direction='column'表示纵向布局。
import { Masonry } from 'react-masonry-component2'
export const MyComponent = (args) => {
return (
<Masonry
direction='column'
columnsCountBreakPoints={{
1400: 5,
1000: 4,
700: 3,
}}
>
<div></div>
<div></div>
<div></div>
</Masonry>
)
}
direction='column'表示横向布局,默认横向布局。
import { Masonry, MasonryItem } from 'react-masonry-component2'
export const MyComponent = (args) => {
return (
<Masonry
columnsCountBreakPoints={{
1400: 5,
1000: 4,
700: 3,
}}
>
<div></div>
<div></div>
<div></div>
</Masonry>
)
}
sortWithHeight 表示按照高度排序,选每列高度最小的添加元素。
import {Masonry, MasonryItem} from 'react-masonry-component2'
export const MyComponent = (args) => {
return (
<Masonry
sortWithHeight
columnsCountBreakPoints={{
1400: 5,
1000: 4,
700: 3,
}}
>
<MasonryItem height={200}>
<div></div>
</MasonryItem>
<MasonryItem height={300}>
<div></div>
</MasonryItem>
<MasonryItem height={400}>
<div></div>
</MasonryItem>
</Masonry>
)
}
useAbsolute 表示使用绝对定位实现瀑布流。
import {Masonry, MasonryAbsoluteItem} from 'react-masonry-component2'
export const MyComponent = (args) => {
return (
<Masonry
useAbsolute
sortWithHeight
columnsCountBreakPoints={{
1400: 5,
1000: 4,
700: 3,
}}
>
<MasonryAbsoluteItem width={100} height={200}>
<div></div>
</MasonryAbsoluteItem>
<MasonryAbsoluteItem width={100} height={300}>
<div></div>
</MasonryAbsoluteItem>
<MasonryAbsoluteItem width={100} height={400}>
<div></div>
</MasonryAbsoluteItem>
</Masonry>
)
}
import MasonryScroll from "react-masonry-component2";
export const MyComponent = (args) => {
return (
<MasonryScroll
preload={false}
fetchApi={() =>
new Promise((resolve, reject) => {
setTimeout(() => {
resolve(MockData.list);
}, 500);
})
}
></MasonryScroll>
);
};
import MasonryScroll from "react-masonry-component2";
export const MyComponent = (args) => {
return (
<MasonryScroll
fetchApi={() =>
new Promise((resolve, reject) => {
setTimeout(() => {
resolve(MockData.list);
}, 500);
})
}
></MasonryScroll>
);
};
FAQs
react 的瀑布流组件库,支持 columns 布局、弹性布局、绝对定位布局三种方法实现
The npm package react-masonry-component3 receives a total of 1 weekly downloads. As such, react-masonry-component3 popularity was classified as not popular.
We found that react-masonry-component3 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
A Shai-Hulud infection exposed Suno's source code, which shows the AI music startup stream-ripped tracks to train its models.

Security News
Vercel is formalizing a monthly release program for Next.js. The change follows React2Shell and a sharp rise in AI-assisted vulnerability discovery.

Research
/Security News
11 malicious NuGet tools pose as game cheats to deploy Windows payloads, track hosts, and use Google Sheets for telemetry and control.