The Principal Dev – Masterclass for Tech Leads

The Principal Dev – Masterclass for Tech LeadsJuly 17-18

Join

minibar

Continuous integration Test coverage Tested with QUnit

minibar is a fast 2kB autocomplete search bar for Typesense. It is an alternative to Algolia DocSearch, InstantSearch, autocomplete-js, typesense-docsearch.js, and typesense-js.

Features

Getting started

Demo

<typesense-minibar data-origin="" data-collection="" data-key="">
  <form role="search" action="https://duckduckgo.com">
    <input type="search" name="q" placeholder="Search..." autocomplete="off">
    <input type="hidden" name="sites" value="example.org">
  </form>
</typesense-minibar>
<link rel="stylesheet" href="typesense-minibar.css">
<script defer type="module" src="typesense-minibar.js"></script>

Distribution:

API

Markup

As HTML custom element (aka Web Component):

<typesense-minibar data-origin="" data-collection="" data-key="">
  <form role="search" action="https://duckduckgo.com">
    <input type="search" name="q" placeholder="Search..." autocomplete="off">
    <input type="hidden" name="sites" value="example.org">
  </form>
</typesense-minibar>

<typesense-minibar><form>…</form></typesense-minibar> is equivalent to <form class="tsmb-form">, which you can also use directly:

<form role="search" action="https://duckduckgo.com" class="tsmb-form"
    data-origin=""
    data-collection=""
    data-key=""
>
  <input type="search" name="q" placeholder="Search..." autocomplete="off">
  <input type="hidden" name="sites" value="example.org">
</form>

Configuration

Set these attributes on <typesense-minibar> or <form class="tsmb-form">:

Styling and theming

The accompanying stylesheet exposes CSS variables that you can override to tweak styles, without writing custom CSS. Alternatively, you can target stable selectors based on the semantic HTML.

Refer to Style API for the CSS variable names and selectors.

Compatibility

typesense-minibar typesense-server typesense-docsearch-scraper
1.0.x >= 0.24 >= 0.6.0.rc1 (Tested upto: 0.9.1)

Browser support

The below matrix describes support for the enhanced JavaScript experience. The HTML experience falls back to submitting a form to DuckDuckGo, and works in all known browsers (including IE 6 and Netscape Navigator).

Browser Policy Version
Firefox Current and previous version,
Current and previous ESR
Firefox 74+ (2020)
Chrome Last three years Chrome 80+ (2020)
Edge Last three years Edge 80+ (2020)
Opera Last three years Opera 67+ (2020)
Safari Last three years Safari 13.1 (2020)
iOS Last three years iOS 13.4 (2020)

Notable feature requirements: ES6 syntax, ES2020 Optional chaining, ES2022 Async functions, DOM NodeList-forEach.

Practical implications:

OS Supported from Running
Android Moto G4 (2016) Android 7.0 with Chrome 80+
Android Samsung Galaxy S7 (2016) Android 7.0 - 8.0
Android Samsung Galaxy A5 (2016) Android 7.0
Android Google Pixel 1 (2016) Android 7.0
iOS iPhone 6S (2015) iOS 13.4 (2020) upto iOS 15 (2022)
Linux Debian 9 Stretch (2018) firefox-esr 91
Linux Debian 10 Buster (2019) firefox-esr 102, chromium 90)
Linux Ubuntu 18.04 LTS (2018) current firefox, current chromium-browser
macOS OS X 10.9 Mavericks (2013-2016) Firefox 78 ESR (2020)
(Safari 7 default unsupported)
macOS OS X 10.13 Mavericks (2017-2020) Firefox 78 ESR (2020), Chrome 80+
(Safari 11 default unsupported)
macOS OS X 10.15 Catalina (2019-2022) Safari 13.1, Firefox 78 ESR (2020), Chrome 80+
Windows Windows 7 (2009) or later current Edge, current Firefox

Notes:

FAQ: Troubleshooting

Feedback

For questions, bug reports, or feature requests, use the Issue tracker.

Join libs.tech

...and unlock some superpowers

GitHub

We won't share your data with anyone else.