{"id":13401122,"url":"https://github.com/gragland/instatype","last_synced_at":"2025-05-07T16:24:20.616Z","repository":{"id":29134125,"uuid":"32664076","full_name":"gragland/instatype","owner":"gragland","description":"⚡️ Mobile-friendly React autocomplete component","archived":false,"fork":false,"pushed_at":"2020-07-24T07:22:34.000Z","size":1862,"stargazers_count":48,"open_issues_count":3,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-24T00:38:52.952Z","etag":null,"topics":["autocomplete","component","react","search","typeahead"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/gragland.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}},"created_at":"2015-03-22T06:01:21.000Z","updated_at":"2023-12-01T07:11:29.000Z","dependencies_parsed_at":"2022-08-02T21:34:05.920Z","dependency_job_id":null,"html_url":"https://github.com/gragland/instatype","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gragland%2Finstatype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gragland%2Finstatype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gragland%2Finstatype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gragland%2Finstatype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gragland","download_url":"https://codeload.github.com/gragland/instatype/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252913710,"owners_count":21824238,"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":["autocomplete","component","react","search","typeahead"],"created_at":"2024-07-30T19:00:58.950Z","updated_at":"2025-05-07T16:24:20.573Z","avatar_url":"https://github.com/gragland.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized","React [🔝](#readme)"],"sub_categories":["Uncategorized"],"readme":"# instatype\nA mobile-friendly React autocomplete component\n\n## Demo\n\u003ca href=\"https://unsplash.now.sh\"\u003eunsplash.now.sh\u003c/a\u003e ([source](https://github.com/gragland/unsplash-demo))\n\n## Install\n`npm install instatype --save`\n\n## Contribute\n`npm run example` to run the example app with hot loading of instatype source for easy development.\n\n## Usage\n```jsx\nimport React from 'react';\nimport Instatype from 'instatype';\n\nclass Component extends React.Component {\n\n  render() {\n    return \u003cInstatype requestHandler={myRequestHandler} selectedHandler={mySelectedHandler}/\u003e;\n  }\n}\n```\n\n## Props\n\nProp                       |    Description\n---------------------------|----------------\n`placeholder`              | Placeholder text for input\n`limit`                    | Number of results to show in dropdown\n`thumbStyle`               | Set result images to \"circle\" or \"square\"\n`loadingIcon`              | Path to custom loading icon\n`requestHandler`           | Required function that fetches data, adds \"image\" and \"name\" properties to each object in the response array, and then passes data back to the instatype component. See an example requestHandler function below.\n`selectedHandler`              | Required function that is called when a dropdown result is clicked. This will be passed the full object initially used to populate that result in the dropdown.\n\n## Example requestHandler\n```js\nrequestHandlerUsers: function(query, limit, callback){\n\n  $.ajax({\n    url: \"https://api.instagram.com/v1/users/search\",\n    dataType: \"jsonp\",\n    data: {\n      client_id: this.props.instagramClientId,\n      q: query,\n      count: limit\n    },\n    success: function(data) {\n      // Instatype expects an \"image\" and \"name\" for each result\n      var renamedData = data.data.map(function(result){\n        result.image = result.profile_picture;\n        result.name = result.username;\n        return result;\n      });\n      \n      callback(renamedData);\n    }\n  });\n\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgragland%2Finstatype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgragland%2Finstatype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgragland%2Finstatype/lists"}