{"id":15628052,"url":"https://github.com/sibiraj-s/react-layout-masonry","last_synced_at":"2025-04-09T21:17:01.151Z","repository":{"id":188682423,"uuid":"679222972","full_name":"sibiraj-s/react-layout-masonry","owner":"sibiraj-s","description":"Responsive masonry layout for React","archived":false,"fork":false,"pushed_at":"2025-03-19T10:01:12.000Z","size":2827,"stargazers_count":42,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T21:16:56.086Z","etag":null,"topics":["react","react-layout","react-masonry"],"latest_commit_sha":null,"homepage":"https://sibiraj-s.github.io/react-layout-masonry/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sibiraj-s.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-16T11:15:15.000Z","updated_at":"2025-04-03T17:47:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"f8b365b3-5434-457c-b74c-d5dd6991a723","html_url":"https://github.com/sibiraj-s/react-layout-masonry","commit_stats":null,"previous_names":["sibiraj-s/react-layout-masonry"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sibiraj-s%2Freact-layout-masonry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sibiraj-s%2Freact-layout-masonry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sibiraj-s%2Freact-layout-masonry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sibiraj-s%2Freact-layout-masonry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sibiraj-s","download_url":"https://codeload.github.com/sibiraj-s/react-layout-masonry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248111973,"owners_count":21049578,"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":["react","react-layout","react-masonry"],"created_at":"2024-10-03T10:20:40.221Z","updated_at":"2025-04-09T21:17:01.126Z","avatar_url":"https://github.com/sibiraj-s.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Layout Masonry\n\n\u003e React Layout Masonry is a flexible and customizable React component for creating dynamic and fixed/responsive masonry\n\u003e layouts.\n\n[![Tests](https://github.com/sibiraj-s/react-layout-masonry/actions/workflows/tests.yml/badge.svg)](https://github.com/sibiraj-s/react-layout-masonry/actions/workflows/tests.yml)\n[![NPM](https://badgen.net/npm/v/react-layout-masonry)](https://www.npmjs.com/package/react-layout-masonry)\n\n## Installation\n\nYou can install React Layout Masonry using npm, pnpm or yarn:\n\n```bash\nnpm install react-layout-masonry\n```\n\nor\n\n```bash\npnpm install react-layout-masonry\n```\n\nor\n\n```bash\nyarn add react-layout-masonry\n```\n\n## Usage\n\n### Fixed Columns Layout\n\nHere's an example of how to use React Layout Masonry with a fixed number of columns in your React application:\n\n```jsx\nimport Masonry from 'react-layout-masonry';\n\nconst FixedColumnsMasonry = () =\u003e {\n  return (\n    \u003cMasonry\n      columns={3}\n      gap={16}\n    \u003e\n      {items.map((item) =\u003e {\n        return \u003cItem {...item} /\u003e;\n      })}\n    \u003c/Masonry\u003e\n  );\n};\n\nexport default FixedColumnsMasonry;\n```\n\n### Responsive Columns Layout\n\nHere's an example of how to use React Layout Masonry with responsive columns in your React application:\n\n```jsx\nimport Masonry from 'react-layout-masonry';\n\nconst ResponsiveColumnsMasonry = () =\u003e {\n  return (\n    \u003cMasonry\n      columns={{ 640: 1, 768: 2, 1024: 3, 1280: 5 }}\n      gap={16}\n    \u003e\n      {items.map((item) =\u003e {\n        return \u003cItem {...item} /\u003e;\n      })}\n    \u003c/Masonry\u003e\n  );\n};\n\nexport default ResponsiveColumnsMasonry;\n```\n\nor use the array syntax\n\n```js\n\u003cMasonry columns={[1, undefined, undefined, 3]} /\u003e\n```\n\nthis will be converted to\n\n```json\n{\n  \"640\": 1,\n  \"1280\": 3\n}\n```\n\nThe array's order corresponds to the default breakpoints, which are `640, 786, 1024, 1280, 1536`.\n\n### Column Props\n\nThe `columnProps` prop allows you to apply additional props to the container of each column. Here's an example:\n\n```jsx\n\u003cMasonry\n  columns={3}\n  gap={16}\n  columnProps={{\n    className: 'custom-column',\n    style: { backgroundColor: 'lightgray' },\n  }}\n\u003e\n  {/* ... */}\n\u003c/Masonry\u003e\n```\n\n## Props\n\n- `columns` (number or object, required): The number of columns in the masonry layout, or an object with breakpoints and corresponding column counts.\n- `gap` (number, optional): The spacing between columns and rows in pixels. Defaults to 0.\n- `columnProps` (object, optional): Additional props to be applied to each column, such as className for styling.\n\n## Examples\n\nFor examples, usage and customization options, please refer to the [docs](docs/src/components/) directory in this repository.\n\n## Contributing\n\nIf you encounter any issues or have questions, please [open an issue](https://github.com/sibiraj-s/react-layout-masonry/issues)\non our GitHub repository. Make sure to create an issue or discussion first before raising a PR\n\n## License\n\nReact Layout Masonry is open-source software licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsibiraj-s%2Freact-layout-masonry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsibiraj-s%2Freact-layout-masonry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsibiraj-s%2Freact-layout-masonry/lists"}