Accessible React component library and design system for building web apps quickly, with dark mode and Next.js RSC support.
algolia/autocomplete
A JavaScript library for building autocomplete and typeahead search boxes, with your own sources and DOM rendering.
- Stars
- 5,265
- Forks
- 339
- Open issues
- 37
- Last commit
- 15 days ago
What is it?
Autocomplete is a JavaScript library for building autocomplete search experiences. You provide a container element and a getSources function that returns the suggestions to display; the library creates the input and handles keyboard interaction and accessibility attributes, while you control the markup of the results.
Sources can be anything: a static list of search terms, results from an Algolia index, recent searches, or data from any other API. The project is split into a core package for building custom renderers and a ready-to-use autocomplete-js package, plus plugins for recent searches, query suggestions, Algolia Insights, redirect URLs and tags.
The library works with any virtual DOM solution, including plain JavaScript, Preact, React and Vue, and is distributed through npm or a CDN script tag.
Key features
- 01Requires only a container and a getSources function to get a working search box.
- 02Generates an accessible input with keyboard navigation and ARIA attributes.
- 03Lets you render results with your own DOM markup.
- 04Provides plugins for recent searches, query suggestions, and Algolia Insights.
- 05Works with plain JavaScript, Preact, React, and Vue.
Use cases
- Adding a search-as-you-type box to a documentation site or content website.
- Showing recent searches and query suggestions in a site search bar.
- Building a custom combobox or command palette with your own result rendering.
Quick start
- 1
Install the autocomplete-js package with npm
npm install @algolia/autocomplete-js - 2
Add a container div to your HTML
- 3
Import autocomplete and call it with the container and getSources options
Things to know
- Requires you to write your own sources and rendering for results beyond the basic setup.
Topics
FAQ
- What is autocomplete?
- A JavaScript library for building autocomplete and typeahead search boxes, with your own sources and DOM rendering. Autocomplete is a JavaScript library for building autocomplete search experiences. You provide a container element and a getSources function that returns the suggestions to display; the library creates the input and handles keyboard interaction and accessibility attributes, while you control the markup of the results.
- Is autocomplete free to use? What license does it have?
- autocomplete is open source under the MIT license. Check the license terms before using it in commercial products.
- Is autocomplete still maintained?
- Actively maintained. The last commit to autocomplete was on Oct 7, 2026.
- What can I use autocomplete for?
- Adding a search-as-you-type box to a documentation site or content website. Showing recent searches and query suggestions in a site search bar. Building a custom combobox or command palette with your own result rendering.
- How do I install autocomplete?
- Install the autocomplete-js package with npm: npm install @algolia/autocomplete-js Add a container div to your HTML Import autocomplete and call it with the container and getSources options
- Where can I get autocomplete?
- The source code and installation instructions are on GitHub: https://github.com/algolia/autocomplete
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Free, touch-first JavaScript slider for mobile websites and apps, with hardware-accelerated transitions and no jQuery dependency.
A cross-platform React Native action sheet (bottom sheet) component for Android, iOS and Web with a flexible API for custom content.
Typesense is an open-source, in-memory search engine with typo tolerance, faceting, geo search and vector search, aimed at being a simpler alternative to Algolia and Elasticsearch.
A user-friendly interactive command line shell for macOS, Linux and other Unix-like systems, with syntax highlighting and autosuggestions out of the box.
Lightweight, schema-less search backend that indexes text and returns identifiers, offered as a small alternative to Elasticsearch.