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
-
Type
peopleordocumentsand press Enter to drill into a nested search. - Press Backspace on an empty box to step back out.
- Pick the same result a few times, reopen, and watch it climb the list.
Settings→Accent colornests three levels deep.Projectskeeps active work above archived work no matter what you pick.- Type
demo errorto see the failure state.
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);
},
});