Skip to content

typeahead.js

A JavaScript library for building autocomplete search boxes that suggest matches as you type.

Stars
16.4k
Forks
3.1k
Licence
MIT
Language
JavaScript
Last update
3.6 years ago
Type
Library

No commits in over a year — check for forks or alternatives before adopting.

What it is

typeahead.js is a JavaScript library for adding autocomplete (typeahead) suggestions to a text input on a web page. It has two parts: Bloodhound, which computes suggestions for a query, and a UI view that renders the suggestions and handles user interaction in the page. The parts can be used separately or together.

  • Add a suggestion dropdown to a site search box
  • Build a local autocomplete from a list of data using the Bloodhound suggestion engine
  • Combine the suggestion engine and UI view to create a typeahead experience

Great for

  • Web developers adding search suggestions to a website's input field
  • Developers who already use jQuery and want a drop-in autocomplete component
  • Teams maintaining existing sites that need to support older desktop browsers

Not ideal for

  • Projects needing mobile browser support, since the README says it is not tested on mobile browsers
  • Projects that do not use jQuery, since the UI view and Bloodhound require jQuery 1.9+ according to the README
  • Non-developers looking for a ready-made app, since this is a code library
Step-by-step guide: how to use typeahead.jsInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: jQuery 1.9+

    Install with Bower (preferred method in README)

    $ bower install typeahead.js
  2. 2

    Run it

    • Install the library with Bower or download the dist files from the README links
    • Include jQuery 1.9+ on the page
    • Include typeahead.bundle.js or the individual files
    • Follow the linked Typeahead and Bloodhound docs to attach it to an input
  3. 3

    Get the most out of it

    • Read the Bloodhound docs to build a suggestion engine from your own data
    • Read the jQuery Typeahead docs for UI options
    • Use the examples page to see working demos before writing code
    • Use the test playground via grunt server when debugging, per the developer section

Downloads

Strengths

  • Two components that can be used separately or together
  • Listed browser support reaches back to older browsers such as IE 8+
  • MIT licensed

Trade-offs

  • README states dependency on jQuery 1.9+ and no mobile browser testing
  • Last push in the metadata is from April 2023, and no release is listed, so current maintenance status is unclear
  • README has limited detail in the excerpt provided, so usage specifics are in linked docs not reviewed here

How it compares

ProjectStarsTypeLevelUpdatedBest for
typeahead.js (this)16.4kLibraryintermediate3.6 years agoWeb developers adding search suggestions to a website's input field
select225.9kLibrarybeginner8 days agoWeb developers who already use jQuery and want a better dropdown

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.