Skip to content

Latest commit

 

History

History
77 lines (54 loc) · 2.38 KB

File metadata and controls

77 lines (54 loc) · 2.38 KB

NPM Downloads NPM Version NPM License Last Commit GitHub Workflow Status

cmd-dialog

A fast, keyboard-driven command dialog and shortcuts palette for web apps.

Light theme Dark theme

Features

  • Built-in dark/light themes
  • Keyboard navigation
  • Customizable action shortcuts with tinykeys
  • Fuzzy search with Fuse.js
  • Native <dialog> element
  • Responsive design

Installation

pnpm add cmd-dialog

Or from CDN:

<script type="module" src="https://esm.sh/cmd-dialog"></script>

Usage

<cmd-dialog placeholder="Search..." hotkey="$mod+k"></cmd-dialog>

<script type="module">
	import "cmd-dialog";

	const dialog = document.querySelector("cmd-dialog");
	dialog.actions = [
		{
			title: "Author's website",
			description: "Roman's personal website",
			url: "https://ozana.cz",
			target: "_blank",
			tags: ["homepage", "contact", "email"],
		},
	];
</script>

See the documentation for details on attributes, events, and action configuration.

Try the live demo.

Dependencies

  • Lit — A simple base class for creating fast, lightweight web components.
  • Fuse.js — Lightweight fuzzy-search library.
  • tinykeys — A robust JavaScript library for capturing keyboard input.

Credits

License

MIT


Made with ♥️ by Roman Ožana