Volver al ranking

algolia/autocomplete

TypeScriptalg.li/autocomplete

🔮 Fast and full-featured autocomplete library

autocompletedropdownsuggestiontypeaheadalgoliasearchmodalquerycomboboxselectaccessiblespotlight
Crecimiento de estrellas
Estrellas
5.3k
Forks
340
Crecimiento semanal
Issues
40
2k4k
jul 2015mar 2019nov 2022jul 2026
Artefactosnpmnpm install autocomplete
README
Autocomplete

A JavaScript library that lets you quickly build autocomplete experiences

Version MIT License

All you need to get started is:

  • A container to inject the experience into
  • Data to fill the autocomplete with
  • Any Virtual DOM solution (JavaScript, Preact, React, Vue, etc.)

The data that populates the autocomplete results are called sources. You can use whatever you want in your sources: a static set of searches terms, search results from an external source like an Algolia index, recent searches, and more.

By configuring just those two required parameters (container and getSources) you can have an interactive autocomplete experience. The library creates an input and provides the interactivity and accessibility attributes, but you're in full control of the DOM elements to output.

Screenshot

DocumentationAPIPlayground

Installation

The recommended way to get started is with the autocomplete-js package. It includes everything you need to render a JavaScript autocomplete experience.

Otherwise, you can install the autocomplete-core package if you want to build a renderer from scratch.

All Autocomplete packages are available on the npm registry.

yarn add @algolia/autocomplete-js
# or
npm install @algolia/autocomplete-js

If you don't use a package manager, you can use the HTML script element:

<script src="https://cdn.jsdelivr.net/npm/@algolia/autocomplete-js"></script>
<script>
  const { autocomplete } = window['@algolia/autocomplete-js'];
</script>

Usage

To get started, you need a container for your autocomplete to go in. If you don't have one already, you can insert one into your markup:

<div id="autocomplete"></div>

Then, insert your autocomplete into it by calling the autocomplete function and providing the container. It can be a CSS selector or an Element.

Make sure to provide a container (e.g., a div), not an input. Autocomplete generates a fully accessible search box for you.

import { autocomplete } from '@algolia/autocomplete-js';

autocomplete({
  container: '#autocomplete',
  // ...
});

Continue reading our Getting Started guide.

Documentation

The documentation offers a few ways to learn about the Autocomplete library:

  • Read the Core Concepts to learn more about underlying principles, like Sources and State.
  • Follow the Guides to understand how to build common UX patterns.
  • Refer to API reference for a comprehensive list of parameters and options.
  • Try out the Playground where you can fork a basic implementation and play around.

You can find more on the documentation.

Support

Packages

Package Description Documentation
autocomplete-js JavaScript package for Autocomplete Documentation
autocomplete-core JavaScript core primitives to build an autocomplete experience Documentation
autocomplete-plugin-recent-searches A plugin to add recent searches to Autocomplete Documentation
autocomplete-plugin-query-suggestions A plugin to add query suggestions to Autocomplete Documentation
autocomplete-plugin-algolia-insights A plugin to add Algolia Insights to Autocomplete Documentation
autocomplete-plugin-redirect-url A plugin to enable redirect URLs Documentation
autocomplete-plugin-tags A plugin to manage and display a list of tags in Autocomplete Documentation
autocomplete-preset-algolia Presets to use Algolia features with Autocomplete Documentation
autocomplete-theme-classic Classic theme for Autocomplete Documentation

Showcase

See the awesome experiences people built with Autocomplete:

DocSearch Algolia Documentation

Find more in our Showcase.

Sandboxes

Check out sandboxes using Autocomplete.

License

MIT

Repositorios relacionados
zsh-users/zsh-autosuggestions

Fish-like autosuggestions for zsh

ShellMIT Licenseshellautosuggest
35.9k1.9k
withfig/autocomplete

IDE-style autocomplete for your existing terminal & shell

TypeScriptnpmMIT Licenseautocompleteterminal
fig.io
25.2k5.4k
dense-analysis/ale

Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support

Vim ScriptBSD 2-Clause "Simplified" Licenselintervim
14k1.5k
downshift-js/downshift

🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.

JavaScriptnpmMIT Licensereactautocomplete
downshift-js.com
12.3k943
microsoft/inshellisense

IDE style command line auto complete

TypeScriptnpmMIT Licenseautocompletebash
10.2k230
httpie/http-prompt

An interactive command-line HTTP and API testing client built on top of HTTPie featuring autocomplete, syntax highlighting, and more. https://twitter.com/httpie

PythonPyPIMIT Licensehttp-clientcli
http-prompt.com
9.1k343
marlonrichert/zsh-autocomplete

🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion.

ShellMIT Licensezshcompletion
6.7k200
chriswalz/bit

Bit is a modern Git CLI

GoGo ModulesApache License 2.0gitcli
6.1k106
ynqa/jnv

Interactive JSON filter using jq

Rustcrates.ioMIT Licenseautocompletecli
6.1k74
lucaong/minisearch

Tiny and powerful JavaScript full-text search engine for browser and Node

TypeScriptnpmMIT Licensefuzzy-searchjavascript
lucaong.github.io/minisearch/
6k170
moroshko/react-autosuggest

WAI-ARIA compliant React autosuggest component

JavaScriptnpmMIT Licensereactautosuggest
react-autosuggest.js.org
5.9k569
remkop/picocli

Picocli is a modern framework for building powerful, user-friendly, GraalVM-enabled command line apps with ease. It supports colors, autocompletion, subcommands, and more. In 1 source file so apps can include as source & avoid adding a dependency. Written in Java, usable from Groovy, Kotlin, Scala, etc.

JavaMavenApache License 2.0javacommandline
picocli.info
5.4k472