0.2.0 • Published 2 years ago

@cmdpalette/react v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

logo

CmdPalette React

A Command Palette Library for your Website or Webapp

Installation

npm install @cmdpalette/core @cmdpalette/react

Usage

See https://cmdpalette.dev/ for example usage.

Properties

commands: Array<ICmdCommand> | () => Promise<Array<ICmdCommand>> - An array of commands to be displayed in the palette. Each command is an object with the following properties:

  • command - The name of the command to be displayed in the palette
  • action - The function to be called when the command is selected, it will receive the command object back as a parameter
  • help - The help text to be displayed in the palette as helper text for your search
  • subCommands - add subcommands in the same format as commands above, they will lazy load when selected (tab)

count: number - The number of commands to be displayed in the palette, defaults to 10

open: boolean - To control the openeing and closing of the palette manually, defaults to false. The palette will self open and close using the key command check if this is not set.

placeholder: string - The placeholder text to be displayed in the search input, defaults to ""

keyCommandCheck: (e: KeyboardEvent) => boolean - To control if the palette should self open and close using a key command check, defaults checking for ctrl+k || command+k.

License

MIT

0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago