{"id":13758272,"url":"https://github.com/dooly-ai/draft-js-typeahead","last_synced_at":"2025-05-10T07:30:48.702Z","repository":{"id":57121993,"uuid":"54751168","full_name":"dooly-ai/draft-js-typeahead","owner":"dooly-ai","description":"Typeaheads for Draft.js inspired by Facebook.com 🔭","archived":true,"fork":false,"pushed_at":"2018-03-23T18:24:46.000Z","size":1368,"stargazers_count":121,"open_issues_count":4,"forks_count":16,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-27T14:02:51.142Z","etag":null,"topics":["draftjs","facebook","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/dooly-ai.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":"2016-03-25T22:30:24.000Z","updated_at":"2024-05-08T17:11:54.000Z","dependencies_parsed_at":"2022-08-24T14:59:22.932Z","dependency_job_id":null,"html_url":"https://github.com/dooly-ai/draft-js-typeahead","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/dooly-ai%2Fdraft-js-typeahead","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dooly-ai%2Fdraft-js-typeahead/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dooly-ai%2Fdraft-js-typeahead/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dooly-ai%2Fdraft-js-typeahead/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dooly-ai","download_url":"https://codeload.github.com/dooly-ai/draft-js-typeahead/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253065386,"owners_count":21848246,"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":["draftjs","facebook","typeahead"],"created_at":"2024-08-03T13:00:23.915Z","updated_at":"2025-05-10T07:30:48.455Z","avatar_url":"https://github.com/dooly-ai.png","language":"JavaScript","funding_links":[],"categories":["Plugins and Decorators Built for Draft.js"],"sub_categories":[],"readme":"# draft-js-typeahead\n\n[![NPM version][npm-image]][npm-url]\n\nTypeaheads for [Draft.js](https://github.com/facebook/draft-js) inspired by Facebook.com.\n\n![example](example.gif)\n\n[Check out an example of mentions in draft using draft-js-typeahead here. 🎉](http://dooly-ai.github.io/draft-js-typeahead/)\n\nThis package provides a higher-order component that wraps draft's `Editor` component and augments it with typeahead superpowers. One popular use for draft-js-typeahead is to add mentions to your editors.\n\n-\n\ndraft-js-typeahead helps in three ways:\n - It figures out *if* and *where* the typeahead should be showing.\n - It keeps track of the typeahead's highlighted item.\n - It triggers a callback when an item is selected (by hitting return).\n\n\n## Installation\n\n```sh\n$ npm install --save draft-js-typeahead\n```\n\n\n## Examples\n\n[Examples are available under the `examples/` directory.](examples/)\n\n\n## Usage\n\nFirst we'll need to import `TypeaheadEditor`:\n\n```javascript\nimport { TypeaheadEditor } from 'draft-js-typeahead';\n```\n\n`TypeaheadEditor` is a react component that wraps draft's `Editor`.\n\n-\n\nIt supports all of the same properties as the latter, as well as a few others:\n\n`onTypeaheadChange =\u003e (typeaheadState)`:\n\nThis method is called when the typeahead's *visibility*, *position*, or *text* changes. `typeaheadState` is an object with `left`, `top`, `text`, and `selectedIndex` properties. A typical callback sets `typeaheadState` on its own state and uses it to render an overlay in its component's `render` method. This method is also called when the typeahead is hidden by passing `null` to `typeaheadState`.\n\n`handleTypeaheadReturn =\u003e (text, selectedIndex, selection)`:\n\nThis method is called when an item in the typeahead is selected (by hitting return). A typical callback autocompletes the editor with the selected item and tags it with a draft entity.\n\n*Note:* By default draft-js-typeahead does not filter items in the typeahead based on the entered text, [see the mentions example for one approach to filtering](/examples/mentions).\n\n\n## License\n\nMIT © [Justin Vaillancourt](mailto:justin@dooly.ai)\n\n\n[npm-image]: https://badge.fury.io/js/draft-js-typeahead.svg\n[npm-url]: https://npmjs.org/package/draft-js-typeahead\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdooly-ai%2Fdraft-js-typeahead","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdooly-ai%2Fdraft-js-typeahead","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdooly-ai%2Fdraft-js-typeahead/lists"}