quickswitcher

A dependency-free command palette for the web — nested searches, breadcrumb navigation, and results ranked by how you actually use them.

Try it

or press Ctrl+K

Things worth trying

Install

npm install @nowtwo-llc/quick-switcher

Use

import lstrQuickSwitcher from '@nowtwo-llc/quick-switcher';
import '@nowtwo-llc/quick-switcher/style.css';

const switcher = lstrQuickSwitcher({
  searchCallback(searchText, resultHandler) {
    const people = ['Zach', 'Stacy', 'Matt', 'Lightster', 'Baxter'];

    resultHandler.setResults(
      people.filter((p) => resultHandler.filters.isMatch(searchText, p))
    );
  },
  selectCallback(selected) {
    console.log(selected.selectedValue);
  },
});