Like a masonry layout;
except that it displays media at its intended aspect ratio.
pnpm add messonry
yarn add messonry
npm i messonry
import MessonryGrid from "messonry";
const MyMessyLandingPage = () => {
const myMediaArray = [
{ src: 'https://url-of-image.com/', mimeType: "image", alt: "description of image" },
{ src: 'https://url-of-video.com/', mimeType: "video", alt: "description of video" },
{ content: <MyCustomComponent /> }
]
const gridOptions = {
useNextImage={true},
nextImageConfig: {
quality: 90,
priority: true,
loading: "eager",
unoptimized: false,
},
}
return (
<>
<MessonryGrid items={media} options={gridOptions} />
</>
)
}
PRs accepted.
Small note: If editing the README, please conform to the standard-readme specification.