{"id":18930102,"url":"https://github.com/labd/react-loqate","last_synced_at":"2026-03-15T18:45:54.771Z","repository":{"id":42976115,"uuid":"304372843","full_name":"labd/react-loqate","owner":"labd","description":"React implementation of the Loqate API.","archived":false,"fork":false,"pushed_at":"2024-08-08T14:59:29.000Z","size":1026,"stargazers_count":9,"open_issues_count":3,"forks_count":15,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-11T01:49:08.129Z","etag":null,"topics":["address-search","loqate","react"],"latest_commit_sha":null,"homepage":"https://github.com/labd/react-loqate","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/labd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2020-10-15T15:39:44.000Z","updated_at":"2024-12-19T10:09:18.000Z","dependencies_parsed_at":"2024-05-02T12:55:21.917Z","dependency_job_id":null,"html_url":"https://github.com/labd/react-loqate","commit_stats":{"total_commits":52,"total_committers":6,"mean_commits":8.666666666666666,"dds":0.5192307692307692,"last_synced_commit":"6383c1ba757c757361f00c945e63a8f7907bf98c"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labd%2Freact-loqate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labd%2Freact-loqate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labd%2Freact-loqate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labd%2Freact-loqate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/labd","download_url":"https://codeload.github.com/labd/react-loqate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249097904,"owners_count":21212373,"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":["address-search","loqate","react"],"created_at":"2024-11-08T11:36:32.643Z","updated_at":"2026-03-15T18:45:54.764Z","avatar_url":"https://github.com/labd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React-Loqate\n\nThis is a React implementation of the loqate APIs. It features an input, typing in which will result in a list of address options. Clicking an option will trigger your callback with that option.\n\n## Usage\n\n### Notes\n\nYou must [polyfill fetch](https://www.npmjs.com/package/whatwg-fetch).\n\n### Installation\n\n```bash\nnpm install react-loqate\n```\n\n### Example\n\n```javascript\nimport AddressSearch from 'react-loqate';\n// to use the default styles for the default components\nimport 'react-loqate/dist/index.css';\n\n// ...\n\u003cAddressSearch\n  locale=\"en-GB\"\n  apiKey=\"AA11-AA11-AA11-AA11\"\n  onSelect={(address) =\u003e console.log(address)}\n/\u003e;\n// ...\n```\n\n### Props\n\n| name                       | type                                                  | required | example                                                             | description                                                                                       |\n| -------------------------- | ----------------------------------------------------- | -------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |\n| apiKey                     | string                                                | yes      | \"AA11-AA11-AA11-AA11\"                                               | Loqate API key                                                                                    |\n| locale                     | string                                                | yes      | \"en-GB\"                                                             | Language to be used                                                                               |\n| onSelect                   | (address) =\u003e void                                     | yes      | address =\u003e console.log(address)                                     | Callback with for Loqate response                                                                 |\n| countries                  | string[]                                              | no       | [\"GB\", \"NL\"]                                                        | Countries to search in                                                                            |\n| limit                      | number                                                | no       | 10                                                                  | Number of options to show                                                                         |\n| classes                    | `{ input?: string, list?: string, listItem?: string}` | no       | { list: 'list' }                                                    | Classnames for the components                                                                     |\n| components                 | see [Customization](#Customization)                   | no       | { Input: CustomInput, List: CustomList, ListItem: CustomListItem, } | Components to overwrite the default ones                                                          |\n| inline                     | boolean                                               | no       | true                                                                | Render results inline with the input                                                              |\n| debounce                   | number                                                | no       | 100                                                                 | Debounce the calls to the Loqate API                                                              |\n| bias                       | boolean                                               | no       | true                                                                | Bias feature when using capture v4 enabled key.\u003cbr\u003eRequires origin to be set.                     |\n| origin                     | string                                                | no       | \"93.184.216.34\"                                                     | Name or ISO 2 or 3 character code of a country, WGS84 coordinates (comma separated) or IP address |\n| disableBrowserAutocomplete | boolean                                               | no       | false                                                               | Disable browser autocomplete on the input field (defaults to true)                                |\n\n### Customization\n\nYou can either style the default input, list and listitem with their respective classes or replace them completely by passing in your own components in the components prop.\n\n**Custom Input and List components must forward a ref!**\n\n**All custom components must pass down their props!**\n\n```javascript\nimport React from 'react';\nimport AddressSearch from 'react-loqate';\n\n\u003cAddressSearch\n  // ...\n  components={{\n    List: forwardRef(({ className, ...rest }, ref) =\u003e (\n      \u003cul\n        className={clsx('react-loqate-default-list', className)}\n        ref={ref}\n        // ...\n        {...rest}\n      /\u003e\n    )),\n    ListItem: ({ suggestion, ...rest }) =\u003e (\n      \u003cli\n        onKeyDown={(e) =\u003e {\n          if (e.key === 'ArrowDown') {\n            e.preventDefault();\n            const next = e.target.nextSibling;\n            if (next) {\n              next.focus();\n            }\n          }\n          if (e.key === 'ArrowUp') {\n            e.preventDefault();\n            const previous = e.taget.previousSibling;\n            if (previous) {\n              previous.focus();\n            }\n          }\n        }}\n        {...rest}\n      \u003e\n        `${suggestion.Text} ${suggestion.Description}`\n      \u003c/li\u003e\n    ),\n  }}\n  classes={{ Input: classes.input }}\n/\u003e;\n```\n\n### Errors\n\nTwo types of errors can be thrown, LoqateError and ReactLoqateError.\nLoqate Errors are errors from the Loqate API. Their structure, causes and resolutions can be [found in the loqate docs](https://www.loqate.com/developers/api/generic-errors/).\n\nCurrently only one ReactLoqateError can be thrown. This error occurs when the Retrieve API returns an empty Items array after querying it with an existing ID.\n\nIt is on you as the implementing party to catch and handle these errors.\n\n### Contributing\n\nThis codebases use [@changesets](https://github.com/changesets/changesets) for release and version management\n\n- Create a feature branch with new features / fixes\n- When your code changes are complete, add a changeset file to your feature branch using `pnpm changeset`\n- Create a PR to request your changes to be merged to main\n- After your PR is merged, GitHub actions will create a release PR or add your changeset to an existing release PR\n- When the release is ready merge the release branch. A new version will automatically be released.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabd%2Freact-loqate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flabd%2Freact-loqate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabd%2Freact-loqate/lists"}