
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
github.com/algolia/autocomplete
All you need to get started is:
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.
Documentation •
API •
Playground
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>
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.
The documentation offers a few ways to learn about the Autocomplete library:
You can find more on the documentation.
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 |
See the awesome experiences people built with Autocomplete:
![]() | ![]() |
---|---|
Find more in our Showcase.
Check out sandboxes using Autocomplete.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.