{"id":13727437,"url":"https://github.com/cometkim/use-pulled-grid","last_synced_at":"2025-10-28T10:32:18.025Z","repository":{"id":57388282,"uuid":"174175476","full_name":"cometkim/use-pulled-grid","owner":"cometkim","description":"A React hook provides responsive grid container style","archived":false,"fork":false,"pushed_at":"2023-12-15T14:36:06.000Z","size":849,"stargazers_count":5,"open_issues_count":11,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T14:39:10.851Z","etag":null,"topics":["css-in-js","react","react-hooks"],"latest_commit_sha":null,"homepage":null,"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/cometkim.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-03-06T15:57:15.000Z","updated_at":"2023-02-02T08:52:51.000Z","dependencies_parsed_at":"2024-01-07T21:07:05.355Z","dependency_job_id":"627e8fcd-bb4d-4d2f-b487-cd662383ead4","html_url":"https://github.com/cometkim/use-pulled-grid","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"c362ed372bb0ab1e236d28e195ab132af40df0c6"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometkim%2Fuse-pulled-grid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometkim%2Fuse-pulled-grid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometkim%2Fuse-pulled-grid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometkim%2Fuse-pulled-grid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cometkim","download_url":"https://codeload.github.com/cometkim/use-pulled-grid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238230249,"owners_count":19437772,"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":["css-in-js","react","react-hooks"],"created_at":"2024-08-03T01:03:56.128Z","updated_at":"2025-10-28T10:32:12.682Z","avatar_url":"https://github.com/cometkim.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# use-pulled-grid\n\n[![NPM](https://img.shields.io/npm/v/use-pulled-grid.svg)](https://www.npmjs.com/package/use-pulled-grid)\n[![Build Status](https://img.shields.io/circleci/project/github/cometkim/use-pulled-grid/master.svg)](https://circleci.com/gh/cometkim/use-pulled-grid)\n[![Coverage](https://img.shields.io/codecov/c/github/cometkim/use-pulled-grid/master.svg)](https://codecov.io/gh/cometkim/use-pulled-grid)\n[![License](https://img.shields.io/github/license/cometkim/use-pulled-grid.svg)](https://github.com/cometkim/use-pulled-grid/blob/master/LICENSE)\n\n:warning: Wait, you don't need JS here! you can do this using **only CSS**\n\n```css\ngrid-template-columns: repeat(auto-fit, minmax(--min-width, 1fr));\n```\n\nUse this code only when you need fallback styles.\n\n----\n\nA React hook provides responsive CSS Grid container\n\n- [x] Calculate CSS properties for grid container to fit the current window width\n- [ ] Get easier to use [animated-css-grid](https://github.com/aholachek/animate-css-grid)\n\n## Live demo\n\nSee in [CodeSandbox](https://codesandbox.io/s/use-pulled-grid-example-41fh0?file=/src/index.js)\n\n## Usage\n\n### Inline style\n\n```jsx\nimport React from 'react'\n\nimport usePulledGrid from 'use-pulled-grid'\n\nconst ProductCardList = ({ products }) =\u003e {\n  const { styles } = usePulledGrid({\n    columnMinWidth: 100, // Each grid items never get smaller than 100px\n    gridGap: 10,\n  })\n\n  return (\n    \u003cdiv style={styles.container}\u003e\n      {products.map(product =\u003e (\n        {/* Wrappers to each child are required for css-animated-grid and fallback style of grid gap */}\n        \u003cdiv key={product.id} style={styles.itemWrapper}\u003e\n            \u003cProductCard {...product}/\u003e\n        \u003c/div\u003e\n      )}\n    \u003c/div\u003e\n  )\n}\n```\n\n### emotion\n\n```jsx\n/* @jsx jsx */\n\nimport React from 'react'\nimport { css, jsx } from '@emotion/core'\n\nimport usePulledGrid from 'use-pulled-grid'\n\nconst ProductCardList = ({ products }) =\u003e {\n  const { styles } = usePulledGrid({\n    columnMinWidth: 100,\n    gridGap: 10,\n  })\n\n  const containerCss = React.useMemo(() =\u003e (\n    css(styles.container)\n  ), [styles.container])\n\n  const itemWrapperCss = React.useMemo(() =\u003e (\n    css(styles.itemWrapper)\n  ), [styles.itemWrapper])\n\n  return (\n    \u003cdiv css={containerCss}\u003e\n      {products.map(product =\u003e (\n        \u003cdiv key={product.id} css={itemWrapperCss}\u003e\n          \u003cProductCard {...product}/\u003e\n        \u003c/div\u003e\n      )}\n    \u003c/Container\u003e\n  )\n}\n```\n\n## Changelog\n\n### v1.1.0\n\n- Cleanup codes\n- Make test coverage 100%\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcometkim%2Fuse-pulled-grid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcometkim%2Fuse-pulled-grid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcometkim%2Fuse-pulled-grid/lists"}