{"id":16211610,"url":"https://github.com/laurabeatris/use-selected-items-hook","last_synced_at":"2025-07-05T17:34:38.376Z","repository":{"id":40283277,"uuid":"277533814","full_name":"LauraBeatris/use-selected-items-hook","owner":"LauraBeatris","description":"Easily select items based on an array","archived":false,"fork":false,"pushed_at":"2023-01-07T22:21:29.000Z","size":6110,"stargazers_count":147,"open_issues_count":20,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-11T10:48:05.652Z","etag":null,"topics":["hooks","nextjs","react","reactjs","typescript"],"latest_commit_sha":null,"homepage":"https://use-selected-items-hook.vercel.app","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/LauraBeatris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2020-07-06T12:19:24.000Z","updated_at":"2024-09-12T21:12:59.000Z","dependencies_parsed_at":"2023-02-08T02:48:23.257Z","dependency_job_id":null,"html_url":"https://github.com/LauraBeatris/use-selected-items-hook","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LauraBeatris%2Fuse-selected-items-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LauraBeatris%2Fuse-selected-items-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LauraBeatris%2Fuse-selected-items-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LauraBeatris%2Fuse-selected-items-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LauraBeatris","download_url":"https://codeload.github.com/LauraBeatris/use-selected-items-hook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814864,"owners_count":20352037,"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":["hooks","nextjs","react","reactjs","typescript"],"created_at":"2024-10-10T10:48:44.347Z","updated_at":"2025-03-16T11:30:51.090Z","avatar_url":"https://github.com/LauraBeatris.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n   \u003cimg src=\"https://raw.githubusercontent.com/LauraBeatris/use-selected-items-hook/master/.github/docs/logo.png\" width=\"400\"/\u003e\n\u003c/p\u003e\n\n[![Author](https://img.shields.io/badge/author-LauraBeatris-283366?style=flat-square)](https://github.com/LauraBeatris)\n[![Languages](https://img.shields.io/github/languages/count/LauraBeatris/use-selected-items-hook?color=%23283366\u0026style=flat-square)](#)\n[![Stars](https://img.shields.io/github/stars/LauraBeatris/use-selected-items-hook?color=283366\u0026style=flat-square)](https://github.com/LauraBeatris/use-selected-items-hook/stargazers)\n[![Forks](https://img.shields.io/github/forks/LauraBeatris/use-selected-items-hook?color=%23283366\u0026style=flat-square)](https://github.com/LauraBeatris/use-selected-items-hook/network/members)\n[![Contributors](https://img.shields.io/github/contributors/LauraBeatris/use-selected-items-hook?color=283366\u0026style=flat-square)](https://github.com/LauraBeatris/use-selected-items-hook/graphs/contributors)\n[![NPM](https://img.shields.io/npm/v/use-selected-items-hook?color=283366\u0026style=flat-square)](https://www.npmjs.com/package/use-selected-items-hook)\n\n---\n\u003cp align=\"center\"\u003e\n   \u003cimg src=\"https://github.com/LauraBeatris/use-selected-items-hook/blob/master/.github/docs/example.gif\" width=\"500\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"https://use-selected-items-hook.vercel.app/\"\u003eCheck out the example\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n# :pushpin: Table of Contents\n\n* [Installation](#construction_worker-installation)\n* [Usage](#pushpin-usage)\n* [API](#computer-api)\n* [Builds](#hammer-builds)\n* [FAQ](#postbox-faq)\n* [Found a bug? Missing a specific feature?](#bug-issues)\n* [Contributing](#tada-contributing)\n* [License](#closed_book-license)\n\n# :construction_worker: Installation\n\n### With Yarn\n\n```bash\nyarn add use-selected-items-hook\n```\n\n### With NPM\n```bash\nnpm install use-selected-items-hook\n```\n\n# :pushpin: [Go to example](./example/pages/index.tsx) \n\n# :computer: API\n\n## Initialization\nTo initialize the `items` array, the `initialItems` must be passed as an argument. It's also possible to initialize the items already with an `isSelected` state, but to do so, it's necessary to provide the `initialSelectedItems` argument.\n\n---\n\n## Return Values\n\n- ``selectedItems``: The items that are currently selected.\n- ``listItems``: The items with the status of ``isSelected``. Refer to the [Usage](#pushpin-usage).\n\n---\n\n## Actions\n\n- ``toggleSingleItem``\n\n- ``toggleAllItems``\n\n# :hammer: Builds\n- `es` (EcmaScript module)\n- `cjs` (CommonJS)\n\n# :postbox: Faq\n\n**Question:** What are the technologies used in this project?\n\n**Answer:** The technologies and libraries used in this project are [React](https://en.reactjs.org/) + [TypeScript](https://www.typescriptlang.org/) and [Immutability Helper](https://github.com/kolodny/immutability-helper) to\nhandle the array manipulation.\n\n# :bug: Issues\n\nFeel free to **file a new issue** with a respective title and description on the the [useSelectItems hook](https://github.com/LauraBeatris/use-selected-items-hook/issues) repository. If you already found a solution to your problem, **I would love to review your pull request**! Have a look at our [contribution guidelines](https://github.com/LauraBeatris/use-selected-items-hook/blob/master/CONTRIBUTING.md) to find out about the coding standards.\n\n# :tada: Contributing\n\nCheck out the [contributing](https://github.com/LauraBeatris/use-selected-items-hook/blob/master/CONTRIBUTING.md) page to see the best places to file issues, start discussions and begin contributing.\n\n# :closed_book: License\n\nReleased in 2020\n\nThis project is under the [MIT license](https://github.com/LauraBeatris/use-selected-items-hook/master/LICENSE).\n\nMade with love by [Laura Beatris](https://github.com/LauraBeatris) 💜🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaurabeatris%2Fuse-selected-items-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaurabeatris%2Fuse-selected-items-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaurabeatris%2Fuse-selected-items-hook/lists"}