command-palette-vue3
TypeScript icon, indicating that this package has built-in type declarations

0.2.9 • Public • Published

Vue-Command-Palette

Command Palette Component For Vue3

Demo

Demo Website

Getting Started

It's recommended to install command-palette-vue3 via npm

 $ npm install command-palette-vue3 --save

This is the example show how you can intergrate command-palette-vue3

<script>
  import CommandPalette from 'command-palette-vue3';
  import "command-palette-vue3/dist/style.css";
  // Optional can disable display by group by adding return false to the isDisplayByGroup
  const isDisplayByGroup = computed(() => {
  return true;
  });
  // Optional delete if donot want to using default light and dark theme
  const themeMode = ref({
    dark: true,
    light: false
  });
  /*
  Optional delete if donot want to using changeTheme function can assign theme directly
  by adding class="light" or class="dark" to <CommandPalette>
  */
  const changeTheme=()=>{
    themeMode.value.dark=!themeMode.value.dark;
    themeMode.value.light=!themeMode.value.light;
  };
  const customerGroups = computed(() => {
  return [
    {groupName:"Default",
    commands:[
      {commandName:"Switch Light/Dark Theme", 
      commandKey:"Control+m", 
      commandAction:() => {changeTheme();}},
      {commandName:"Test Command", 
      commandKey:"Control+Shift+m", 
      commandAction:() => {alert("Test Command excecute.")}},
      ]},
  ];
});
</script>
<template>
<CommandPalette :themeMode="themeMode" :customerGroups="customerGroups" :isDisplayByGroup="isDisplayByGroup"/>
</template>

Props

Prop Description Type Default
themeMode select the theme of the command palette object {dark:true, light: false}
modalKey command palette open modal keys string "Control+k"
customerCommandByGroup array included all command by group array [Object]
isDisplayByGroup option to display by group or not boolean false

Object

return [
    {groupName:"Default",
    commands:[
      {commandName:"Test Command", 
      commandKey:"Control+Shift+m", 
      commandAction:() => {alert("Test Command excecute.")}},
      ]},
  ];
});
Name Description
groupName Name of the Command Group
commandName Name of the Command
commandKey Keys to execute Command
commandAction Action the command with execute

Slots

Name Description
cmd-item custom the item in the result

ChangeLog

CHANGELOG

License

Copyright (c) 2022-present test

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.2.91latest

Version History

VersionDownloads (Last 7 Days)Published
0.2.91
0.2.80
0.2.70
0.2.60
0.2.50
0.2.40
0.2.30
0.2.20
0.2.10
0.2.00
0.1.90
0.1.80
0.1.70
0.1.60
0.1.50
0.1.40
0.1.30
0.1.20
0.1.10
0.1.00
0.0.100
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10
0.0.00

Package Sidebar

Install

npm i command-palette-vue3

Weekly Downloads

1

Version

0.2.9

License

none

Unpacked Size

271 kB

Total Files

28

Last publish

Collaborators

  • dat.ngo2211