11# Svelte Command Palette  
22
3- ### Increase your productivity exponentially. 🚀🚀  
3+ ####  Increase your productivity exponentially. 🚀🚀  
44
55#### Get started with command-palette with 2.1Kb Minified and ~ 700B Gzipped + Minified  
66
77## Demo  
88
9- ![ svelte-command-palette] ( https://rohit-misc.s3.ap-south-1.amazonaws.com/svelte-command-palette.gif ) 
9+ 
1010
1111## Features  
1212
@@ -37,11 +37,11 @@ Install svelte-command-palette with npm
3737
3838    const  actions  =  defineActions ([
3939        {
40-             actionId :  1 ,
40+             id :  1 ,
4141            title:  " Open Svelte Command Palette on github"  ,
42-             subTitle:  " This opens github in a new tab!"  ,
42+             subTitle:  ' This opens github in a new tab!",
4343            onRun: ({ action, storeProps, storeMethods }) => { 
44-                 window .open (" https://github.com/rohitpotato/svelte-command-palette"  )
44+                 window.open("https://github.com/rohitpotato/svelte-command-palette"),  
4545            }, 
4646            shortcut: "Space k" 
4747        } 
@@ -50,6 +50,50 @@ Install svelte-command-palette with npm
5050
5151// render your command palette at the root of your application, say _layout.svelte 
5252
53- < CommandPalette {actions}  / > 
53+ <CommandPalette {actions}> 
5454
5555``` 
56+ 
57+ ## API 
58+ 
59+ ### Component Styling API 
60+ 
61+ The `<CommandPalette />` component accepts the following optional properties for styling: 
62+ 
63+ | Property                     | Type                             | Default                | Description                                                            | 
64+ | ---------------------------- | -------------------------------- | ---------------------- | ---------------------------------------------------------------------- | 
65+ | **unstyled**                 | boolean                          | `false`                | When `true`, the default styles are not applied to the modal elements. | 
66+ | **placeholder**              | string                           | `"Search for actions"` | Placeholder for the command palette input                              | 
67+ | **overlayClass**             | string \|  null                   | `null`                 | Class name for the palette overlay.                                    | 
68+ | **paletteWrapperInnerClass** | string \|  null                   | `null`                 | Class name for the cmd palette wrapper element.                        | 
69+ | **inputClass**               | string \|  null                   | `null`                 | Class name for the cmd palette input.                                  | 
70+ | **resultsContainerClass**    | string \|  null                   | `null`                 | Class name for the results container.                                  | 
71+ | **resultContainerClass**     | string \|  null                   | `null`                 | Class name for the result item container.                              | 
72+ | **optionSelectedClass**      | string \|  null                   | `null`                 | Class name for the currently selected result item.                     | 
73+ | **titleClass**               | string \|  null                   | `null`                 | Class name for the result title.                                       | 
74+ | **subtitleClass**            | string \|  null                   | `null`                 | Class name for the result subtitle.                                    | 
75+ | **descriptionClass**         | string \|  null                   | `null`                 | Class name for the result description.                                 | 
76+ | **keyboardButtonClass**      | string \|  null                   | `null`                 | Class name for the keyboard shortcuts.                                 | 
77+ | **overlayStyle**             | Record<string, string \|  number> | `{}`                   | Style properties of the overlay.                                       | 
78+ | **paletteWrapperInnerStyle** | Record<string, string \|  number> | `{}`                   | Style properties of the command palette wrapper element.               | 
79+ | **inputStyle**               | Record<string, string \|  number> | `{}`                   | Style properties of cmd palette input.                                 | 
80+ | **resultsContainerStyle**    | Record<string, string \|  number> | `{}`                   | Style properties of results container.                                 | 
81+ | **resultContainerStyle**     | Record<string, string \|  number> | `{}`                   | Style properties result item container.                                | 
82+ | **titleStyle**               | Record<string, string \|  number> | `{}`                   | Style properties for result item title.                                | 
83+ | **subtitleStyle**            | Record<string, string \|  number> | `{}`                   | Style properties for result item subtitle.                             | 
84+ | **descriptionStyle**         | Record<string, string \|  number> | `{}`                   | Style properties for result item description.                          | 
85+ | **optionSelectedStyle**      | Record<string, string \|  number> | `{}`                   | Style properties selected result item.                                 | 
86+ | **keyboardButtonStyle**      | Record<string, string \|  number> | `{}`                   | Style properties for the keyboard shortcut.                            | 
87+ 
88+ ## Action API 
89+ 
90+ ``` 
91+ 	actionId?: ActionId; 
92+ 	canActionRun?: (args: onRunParams) => boolean; 
93+ 	title: string; 
94+ 	description?: string; 
95+ 	subTitle?: string; 
96+ 	onRun?: (args: onRunParams) => void; 
97+ 	keywords?: Array<string>; 
98+ 	shortcut?: string; 
99+ ``` 
0 commit comments