{"id":20656404,"url":"https://github.com/wakamsha/use-listbox","last_synced_at":"2025-04-19T12:24:47.377Z","repository":{"id":37040310,"uuid":"442132203","full_name":"wakamsha/use-listbox","owner":"wakamsha","description":"A simple React Hook that Provides the behavior and accessibility implementation for a listbox component.","archived":false,"fork":false,"pushed_at":"2025-04-06T21:24:12.000Z","size":3380,"stargazers_count":1,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T22:25:19.249Z","etag":null,"topics":["accessibility","contextmenu","custom-hooks","hooks","menu","navigation","react","wai-aria"],"latest_commit_sha":null,"homepage":"https://wakamsha.github.io/use-listbox/?path=/docs/uselistbox--basic","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/wakamsha.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-27T10:52:06.000Z","updated_at":"2024-01-12T18:25:34.000Z","dependencies_parsed_at":"2024-03-19T00:30:21.644Z","dependency_job_id":"a61bfe84-76d4-489d-9137-3bc8ab4d636c","html_url":"https://github.com/wakamsha/use-listbox","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wakamsha%2Fuse-listbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wakamsha%2Fuse-listbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wakamsha%2Fuse-listbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wakamsha%2Fuse-listbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wakamsha","download_url":"https://codeload.github.com/wakamsha/use-listbox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249692921,"owners_count":21311421,"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":["accessibility","contextmenu","custom-hooks","hooks","menu","navigation","react","wai-aria"],"created_at":"2024-11-16T18:15:06.895Z","updated_at":"2025-04-19T12:24:47.341Z","avatar_url":"https://github.com/wakamsha.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# use-listbox\n\n\u003e A simple React Hook that Provides the behavior and accessibility implementation for a listbox component.\n\n**[Demo and Document](https://wakamsha.github.io/use-listbox/?path=/docs/uselistbox--basic)**\n\n![mv](https://user-images.githubusercontent.com/2629981/147489862-a9f6d7c1-6ea6-41e8-8472-a50d768c0c7f.gif)\n\n## FEATURES\n\n- Exposed to assistive technology as a listbox using ARIA\n- Zero dependencies\n- Tiny size\n\n## INSTALL\n\n```bash\n# with Yarn\nyarn add @wakamsha/use-listbox\n\n# with npm\nnpm install @wakamsha/use-listbox\n```\n\n### GETTING STARTED\n\n```tsx\nimport { useListBox } from '@wakamsha/use-listbox';\n\nexport const App = () =\u003e {\n  const menuItems = ['foo', 'bar', 'baz'];\n\n  const { itemProps, active, triggerProps } = useListBox(menuItems.length);\n\n  return (\n    \u003csection aria-expanded={active}\u003e\n      \u003cbutton {...triggerProps}\u003eOpen\u003c/button\u003e\n      \u003cul role=\"menu\" aria-hidden={!active}\u003e\n        {menuItems.map((item, index) =\u003e (\n          \u003cli key={item}\u003e\n            \u003cbutton {...itemProps[index]} onClick={alert}\u003e\n              {item}\n            \u003c/button\u003e\n          \u003c/li\u003e\n        ))}\n      \u003c/ul\u003e\n    \u003c/section\u003e\n  );\n};\n```\n\n## LICENSE\n\n[MIT license](https://en.wikipedia.org/wiki/MIT_License).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwakamsha%2Fuse-listbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwakamsha%2Fuse-listbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwakamsha%2Fuse-listbox/lists"}