whatisgithub

What is typeahead.js?

twitter/typeahead.js — explained in plain English

Analysis updated 2026-06-24

16,461JavaScriptAudience · developerComplexity · 2/5LicenseSetup · easy

In one sentence

A jQuery autocomplete library from Twitter. Shows suggestions in a dropdown as the user types in a text input, pulling from local data or a remote endpoint.

Mindmap

mindmap
  root((typeahead.js))
    Inputs
      Text field input
      Local dataset
      Remote endpoint
    Outputs
      Suggestion dropdown
      Selected value
    Use Cases
      Search box autocomplete
      Form field suggestions
      Tag picker
    Tech Stack
      JavaScript
      jQuery
      Bloodhound
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add an autocomplete dropdown to a search box on a jQuery site

USE CASE 2

Build a tag input that suggests from a remote API as the user types

USE CASE 3

Replace browser native autocomplete with a styled custom dropdown

What is it built with?

JavaScriptjQueryBloodhound

How does it compare?

twitter/typeahead.jsalsotang/node-lessonsruanyf/react-demos
Stars16,46116,46116,481
LanguageJavaScriptJavaScriptJavaScript
Last pushed2024-10-29
MaintenanceStale
Setup difficultyeasyeasyeasy
Complexity2/51/51/5
Audiencedeveloperdevelopervibe coder

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Requires jQuery 1.9 or later and is not tested on mobile browsers.

MIT license. Use freely for any purpose including commercial, just keep the copyright notice.

So what is it?

Typeahead.js is a JavaScript library for building autocomplete (also called typeahead) inputs, the kind where suggestions appear below a text field as you type. It was created by Twitter, inspired by the autocomplete search box on twitter.com. The library has two separate parts that work together. The first is Bloodhound, the suggestion engine, the behind-the-scenes logic that figures out what suggestions to show based on what the user has typed. It can fetch suggestions from a remote source or use a pre-loaded local dataset. The second part is the Typeahead UI view, which handles rendering the dropdown list of suggestions and responding to user interactions like clicking a suggestion or pressing the arrow keys. Both parts can be used independently if you only need one piece, but together they give you a complete, polished autocomplete experience. The library depends on jQuery (version 1.9 or later), so it is designed for projects that already use jQuery. You add it to your page by including one of several downloadable bundles: a combined bundle with both components, or the two parts separately. You would reach for typeahead.js when you want to add an autocomplete feature to a search box or form field on a web page and want more control and flexibility than browser-native autocomplete provides. It supports the major desktop browsers including Chrome, Firefox, Safari, Internet Explorer, and Opera. Note that the library is not tested on mobile browsers.

Copy-paste prompts

Prompt 1
Show me a minimal HTML page that wires typeahead.js to a local array of city names
Prompt 2
Set up Bloodhound with a remote endpoint that returns JSON and debounce requests
Prompt 3
Style the typeahead.js dropdown to match a Bootstrap 5 form input
Prompt 4
Migrate a typeahead.js setup to a modern alternative that does not need jQuery

Frequently asked questions

What is typeahead.js?

A jQuery autocomplete library from Twitter. Shows suggestions in a dropdown as the user types in a text input, pulling from local data or a remote endpoint.

What language is typeahead.js written in?

Mainly JavaScript. The stack also includes JavaScript, jQuery, Bloodhound.

What license does typeahead.js use?

MIT license. Use freely for any purpose including commercial, just keep the copyright notice.

How hard is typeahead.js to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is typeahead.js for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.