{"id":15784842,"url":"https://github.com/shubhamzanwar/react-masonry-grid","last_synced_at":"2025-04-30T22:22:59.725Z","repository":{"id":35098501,"uuid":"206124192","full_name":"shubhamzanwar/react-masonry-grid","owner":"shubhamzanwar","description":"An awesome react module that enables you to create masonry grids ⭐️","archived":false,"fork":false,"pushed_at":"2023-01-04T08:52:10.000Z","size":1053,"stargazers_count":10,"open_issues_count":29,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-11T20:18:48.041Z","etag":null,"topics":["library","portfolio","react"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shubhamzanwar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-03T16:37:44.000Z","updated_at":"2021-04-26T07:20:01.000Z","dependencies_parsed_at":"2023-01-15T13:49:02.491Z","dependency_job_id":null,"html_url":"https://github.com/shubhamzanwar/react-masonry-grid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhamzanwar%2Freact-masonry-grid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhamzanwar%2Freact-masonry-grid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhamzanwar%2Freact-masonry-grid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhamzanwar%2Freact-masonry-grid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shubhamzanwar","download_url":"https://codeload.github.com/shubhamzanwar/react-masonry-grid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251790263,"owners_count":21644192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library","portfolio","react"],"created_at":"2024-10-04T20:05:49.873Z","updated_at":"2025-04-30T22:22:59.703Z","avatar_url":"https://github.com/shubhamzanwar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react masonry grid\n\n[![downloads](https://img.shields.io/npm/dm/react-masonry-grid.svg) ![version](https://img.shields.io/npm/v/react-masonry-grid) ![size](https://img.shields.io/bundlephobia/min/react-masonry-grid)](https://www.npmjs.com/package/react-masonry-grid)\n\nThis helpful little package allows you to easily render masonry(space-efficient) grids using react.\n\n\u003e **What** is a masonry grid?\n\n\u003csub\u003eHave a look :D\u003c/sub\u003e\n\n![masonry grid](https://raw.githubusercontent.com/shubhamzanwar/react-masonry-grid/master/docs/masonry.png)\n\n#### Demo:\n\nClone this repo and run the following:\n\n```shell\nnpm install\n```\n\nTo see the demo for images in the grid:\n\n```shell\nnpm run demo:images\n```\n\nTo see the demo for textual content:\n\n```shell\nnpm run demo:text\n```\n\n#### Installation\n\nThis package is available as a npm module. To install it:\n\n```shell\nnpm install react-masonry-grid\n```\n\n#### Usage\n\nUse it in your app\n\n```js\n\nconst images = [\n    'https://media0.giphy.com/media/i67uIY4a61ejm/giphy_s.gif?cid=5426f43fd0ed6f56dd3a69975ff92370ee725f8e98ab9028\u0026rid=giphy_s.gif',\n    'https://media1.giphy.com/media/Z5W9H5DtCWN4k/giphy_s.gif?cid=5426f43fd0ed6f56dd3a69975ff92370ee725f8e98ab9028\u0026rid=giphy_s.gif',\n    'https://media3.giphy.com/media/443jTSLWYgLJQysB1z/giphy_s.gif?cid=5426f43fd0ed6f56dd3a69975ff92370ee725f8e98ab9028\u0026rid=giphy_s.gif',\n    'https://media3.giphy.com/media/SVqgwI1EIrjLfZyyfD/giphy_s.gif?cid=5426f43fd0ed6f56dd3a69975ff92370ee725f8e98ab9028\u0026rid=giphy_s.gif',\n    'https://media0.giphy.com/media/iCiyEytDbvR62GFfbb/giphy_s.gif?cid=5426f43fd0ed6f56dd3a69975ff92370ee725f8e98ab9028\u0026rid=giphy_s.gif'\n]\n\n\u003cGrid gutter={10} columnWidth={200} rowHeight={10}\u003e\n    {images.map((image) =\u003e (\n        \u003cGridItem\u003e\n            \u003cimg src={image} style={{width: '100%' }}/\u003e\n        \u003c/GridItem\u003e\n    ))}\n\u003c/Grid\u003e\n```\n\n### Props\n\nThe `Grid` component takes the following props:\n\n- `gutter`: The gap, in `px`,  between each row and each column of the grid\n- `columnWidth`: The width, in `px`, of each individual column\n- `rowHeight`: The height, in `px`, of each row.\n**Note**: Each `GridItem` may span multiple rows. `rowHeight` is the minimum height of one such row.\n\nThe `GridItem` component takes no props but is needed to be used as it watches its children and recalculates it's height whenever the children load.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubhamzanwar%2Freact-masonry-grid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshubhamzanwar%2Freact-masonry-grid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubhamzanwar%2Freact-masonry-grid/lists"}