{"id":50926166,"url":"https://github.com/ruicsh/use-combo-box","last_synced_at":"2026-06-16T23:04:09.008Z","repository":{"id":50336241,"uuid":"518804480","full_name":"ruicsh/use-combo-box","owner":"ruicsh","description":"Headless combo box hook for React","archived":false,"fork":false,"pushed_at":"2025-01-03T21:18:53.000Z","size":1279,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-30T03:08:30.249Z","etag":null,"topics":["aria","combobox","headless","react","reacthooks"],"latest_commit_sha":null,"homepage":"","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/ruicsh.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-07-28T10:41:01.000Z","updated_at":"2026-04-06T19:48:56.000Z","dependencies_parsed_at":"2024-04-14T01:29:34.726Z","dependency_job_id":"1af07c48-842b-46bf-8c7c-07999824c7cd","html_url":"https://github.com/ruicsh/use-combo-box","commit_stats":null,"previous_names":["ruicsh/use-combo-box"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/ruicsh/use-combo-box","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruicsh%2Fuse-combo-box","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruicsh%2Fuse-combo-box/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruicsh%2Fuse-combo-box/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruicsh%2Fuse-combo-box/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruicsh","download_url":"https://codeload.github.com/ruicsh/use-combo-box/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruicsh%2Fuse-combo-box/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34426757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["aria","combobox","headless","react","reacthooks"],"created_at":"2026-06-16T23:04:08.074Z","updated_at":"2026-06-16T23:04:08.986Z","avatar_url":"https://github.com/ruicsh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"docs/logo.png\" alt=\"Logo\" width=\"120\" height=\"120\"\u003e\n  \u003ch1 align=\"center\"\u003euse-combo-box\u003c/h3\u003e\n  \u003cp align=\"center\"\u003eHeadless combo-box hook for React\u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/@tuplo/use-combo-box\"\u003e\n    \u003cimg src=\"https://img.shields.io/bundlephobia/minzip/@tuplo/use-combo-box\"\u003e\n  \t\u003ca href=\"https://codeclimate.com/github/tuplo/use-combo-box/test_coverage\"\u003e\u003cimg src=\"https://api.codeclimate.com/v1/badges/309c1f1e7ab197b5453e/test_coverage\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n## Why\n\nWe tried `downshift` but it was too heavy for our needs.\n\n- No dependencies\n- Tiny footprint (1.12 kB)\n- WAI-ARIA compliant, implements the [Combobox pattern](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/)\n- Keyboard navigation\n\n## Install\n\n```bash\n$ npm install @tuplo/use-combo-box\n\n# or with yarn\n$ yarn add @tuplo/use-combo-box\n```\n\n## Usage\n\nMinimal example\n\n```jsx\nimport { useComboBox } from \"@tuplo/use-combo-box\";\n\nfunction ComboBox() {\n  const {\n    getComboBoxProps,\n    getInputProps,\n    getItemProps,\n    getLabelProps,\n    getMenuProps,\n    getToggleButtonProps,\n    items,\n  } = useComboBox({\n    id: \"my-combo-box\",\n    onSelectedItemChange: (item) =\u003e console.log(item),\n  });\n\n  return (\n    \u003cdiv\u003e\n      \u003clabel {...getLabelProps()}\u003eChoose\u003c/label\u003e\n      \u003cdiv {...getComboBoxProps()}\u003e\n        \u003cinput {...getInputProps()} /\u003e\n        \u003cbutton {...getToggleButtonProps()}\u003eToggle\u003c/button\u003e\n      \u003c/div\u003e\n      \u003cul {...getMenuProps()}\u003e\n        {items.map((item, index) =\u003e (\n          \u003cli key={item.label} {...getItemProps({ item, index })}\u003e\n            {item.label}\n          \u003c/li\u003e\n        ))}\n      \u003c/ul\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n## Options\n\n```typescript\nconst comboBoxProps = useComboBox({\n  filterFn: async (keyword, items) =\u003e\n    items.filter((item) =\u003e item.label.includes(keyword)),\n  id: \"my-combo-box\",\n  initialIsOpen: true,\n  items: [\n    { id: \"item-1\", label: \"Alice\" },\n    { id: \"item-2\", label: \"Bob\" },\n  ],\n  itemToString: (item) =\u003e item.id,\n  label: \"Team members\",\n  onInputValueChange: (value) =\u003e console.log(value),\n  onSelectedItemChange: (item) =\u003e console.log(item),\n  placeholder: \"Choose team member\",\n  selectedValues: [\"item-1\", \"item-2\"]\n});\n```\n\n### filterFn\n\n\u003e `(keyword: string, items: ItemType[]) =\u003e Promise\u003cItemType[]\u003e` | optional\n\nA custom function to be called when filtering the list of items according to the keyword typed in by the user.\n\n### id\n\n\u003e `string` | required\n\nUnique identifier for this widget. It's used to build IDs for all child elements.\n\n### initialIsOpen\n\n\u003e `boolean` | optional\n\nSets the open state of the menu when the combo-box is initialized.\n\n### itemToString\n\n\u003e `(item: ItemType) =\u003e string` | defaults to `JSON.stringify(item)`\n\nIf your items are stored as objects, this function is used to create unique IDs for each option.\n\n### items\n\n\u003e `ItemType[]` | optional\n\nList of initial items to show on menu. When empty, the list is populated by the return value of `filterFn`.\n\n### label\n\n\u003e `string` | optional\n\nExplicit value to be used on `aria-label`.\n\n### onInputValueChange\n\n\u003e `(value: string) =\u003e void` | optional\n\nCallback to be used when user changes the input value on the textbox.\n\n### onSelectedItemChange\n\n\u003e `(item: ItemType) =\u003e void` | required\n\nCallback to be used when user picks an item.\n\n### placeholder\n\n\u003e `string` | optional\n\nTo be used as placeholder text on the textbox.\n\n### selectedValue\n\n\u003e `string` | optional\n\nThe selected value. Makes it a single-selection combo-box.\n\n### selectedValues\n\n\u003e `string[]` | optional\n\nList of selected values. Makes it a multi-selection combo-box.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruicsh%2Fuse-combo-box","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruicsh%2Fuse-combo-box","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruicsh%2Fuse-combo-box/lists"}