{"id":19852987,"url":"https://github.com/ship-components/ship-components-grid","last_synced_at":"2026-04-09T07:05:28.033Z","repository":{"id":57358467,"uuid":"66503662","full_name":"ship-components/ship-components-grid","owner":"ship-components","description":"React masonry grid","archived":false,"fork":false,"pushed_at":"2018-12-06T20:16:59.000Z","size":49,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-12T15:53:22.713Z","etag":null,"topics":["babel","javascript","javascript-library","jsx","loader","masonry","react","ship-components-grid","webpack"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ship-components-grid","language":"JavaScript","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/ship-components.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-24T22:14:18.000Z","updated_at":"2020-10-19T11:01:10.000Z","dependencies_parsed_at":"2022-09-06T21:41:24.028Z","dependency_job_id":null,"html_url":"https://github.com/ship-components/ship-components-grid","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ship-components%2Fship-components-grid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ship-components%2Fship-components-grid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ship-components%2Fship-components-grid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ship-components%2Fship-components-grid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ship-components","download_url":"https://codeload.github.com/ship-components/ship-components-grid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241241900,"owners_count":19932839,"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":["babel","javascript","javascript-library","jsx","loader","masonry","react","ship-components-grid","webpack"],"created_at":"2024-11-12T14:05:07.588Z","updated_at":"2025-12-30T22:55:30.601Z","avatar_url":"https://github.com/ship-components.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ship-components-grid\n[React](http://facebook.github.io/react/) [masonry](http://masonry.desandro.com/) layout. Exports a commonjs module that can be used with [webpack](http://webpack.github.io/). Source is in ES6 and is compiled down to ES5 using [Babel](https://babeljs.io/).\n\n[![npm](https://img.shields.io/npm/v/ship-components-grid.svg?maxAge=2592000)](https://www.npmjs.com/package/ship-components-grid)\n[![Build Status](http://img.shields.io/travis/ship-components/ship-components-grid/master.svg?style=flat)](https://travis-ci.org/ship-components/ship-components-grid)\n[![Coverage](http://img.shields.io/coveralls/ship-components/ship-components-grid.svg?style=flat)](https://coveralls.io/github/ship-components/ship-components-grid)\n[![devDependencies](https://img.shields.io/david/dev/ship-components/ship-components-grid.svg?style=flat)](https://david-dm.org/ship-components/ship-components-grid?type=dev)\n\n## Usage\n\n### ES6/JSX (Recommended)\nThe component is written using ES6/JSX therefore Babel is recommended to use it. The below example is based on using [webpack](http://webpack.github.io/) and [babel-loader](https://github.com/babel/babel-loader).\n```js\nimport React from 'react';\nimport Grid from 'ship-components-grid';\n\nexport default class View extends React.Component {\n  render() {\n    return (\n      \u003cGrid\n        className='grid'\n        fitWidth\n      \u003e\n        {this.props.items.map(item =\u003e {\n          return (\n            \u003cdiv\n              key={item.id}\n              // Grid appends a classname to all children. It's required for\n              // masonry to work.\n              className={item.className}\n            /\u003e\n          )\n        })}\n      \u003c/Grid\u003e\n    );\n  }\n}\n```\n\n## Examples and Development\nExamples can be found in the `examples/` folder. A development server can be run with:\n\n```shell\n$ npm install\n$ npm start\n```\n\nThis will live reload any changes you make and serve them at http://localhost:8080.\n\n### Webpack Configuration\nThis module is designed to be used with webpack but requires a few loaders if you are pulling the source into another project.\n\n```shell\n$ npm install webpack babel-loader --save-dev\n```\n\nBelow are is a sample of how to setup the loaders:\n\n```js\n/**\n * Relevant Webpack Configuration\n */\n{\n  [...]\n  module: {\n    loaders: [\n      // Setup support for ES6\n      {\n        test: /\\.(jsx?|es6)$/,\n        exclude: /node_modules/,\n        loader: 'babel'\n      },\n      // ES6/JSX for external ship-components modules\n      {\n        test: /\\.(jsx?|es6)$/,\n        include: [\n          /ship-components\\-.*\\/src/\n        ],\n        loader: 'babel'\n      }\n    ]\n  }\n  [...]\n}\n```\n\n## Tests\n1. `npm install`\n2. `npm test`\n\n## History\n* 0.3.0 - Updates to the latest babel configurations (babel-preset-env)\n* 0.2.4 - Updates Jests, Travis CI and Coveralls as well as minor ESLint and React warning messages\n* 0.2.3 - Added Internet Explorer(10 \u0026 11) onResize event support\n* 0.2.2 - Added more fixes for narrow screens\n* 0.2.1 - Added a fix to not update layout when masonry isn't active\n* 0.2.0 - Added option to disable under certain widths\n* 0.1.0 - Initial\n\n## License\nThe MIT License (MIT)\n\nCopyright (c) 2016 SHIP\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fship-components%2Fship-components-grid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fship-components%2Fship-components-grid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fship-components%2Fship-components-grid/lists"}