wetmarble / svelte-command-palette

A simple command palette for svelte

Home Page:svelte-command-palette.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Svelte Command Palette

Increase your productivity exponentially. πŸš€πŸš€

Demo

svelte-command-palette

Features

  • Fuzzy search powered by fuse.js
  • Run actions conditionally
  • Super simple API, just define your actions and it just works!
  • Advanced conditional actions - decide whether to run your action based on the current state of your command palette
  • Access to paletteStore , update your update palette store from anywhere to make updates to your command-palette.
  • Keyboard shortcuts - define keyboard shortcuts for your actions!

and more

Installation

Install svelte-command-palette with npm

  npm install svelte-command-palette

Usage/Examples

<script>
    import CommandPalette, { defineActions } from 'svelte-command-palette'

    // define actions using the defineActions API

    const actions = defineActions([
        {
            id: 1,
            title: "Open Svelte Command Palette on github",
            subTitle: 'This opens github in a new tab!",
            onRun: ({ action, storeProps, storeMethods }) => {
                window.open("https://github.com/rohitpotato/svelte-command-palette"),
            },
            shortcut: "Space k"
        }
    ])
</script>

// render your command palette at the root of your application, say _layout.svelte

<CommandPalette {actions}>

About

A simple command palette for svelte

svelte-command-palette.vercel.app


Languages

Language:Svelte 53.3%Language:HTML 25.0%Language:TypeScript 14.0%Language:JavaScript 7.6%Language:CSS 0.1%