Skip to content

Commit 3ce5c84

Browse files
committed
Added readme and script
1 parent e29aa13 commit 3ce5c84

File tree

2 files changed

+39
-24
lines changed

2 files changed

+39
-24
lines changed

README.md

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,53 @@
1-
# create-svelte
1+
# Svelte Command Palette
22

3-
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
3+
### Increase your productivity exponentially. 🚀🚀
44

5-
## Creating a project
5+
## Demo
66

7-
If you're seeing this, you've probably already done this step. Congrats!
7+
![svelte-command-palette](https://rohit-misc.s3.ap-south-1.amazonaws.com/svelte-command-palette.gif?response-content-disposition=inline&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEAcaCmFwLXNvdXRoLTEiSDBGAiEArQtcSxpqlkpMiIXIRbzim6ygEdu%2FiWM0JafqMC67%2F%2FMCIQCyrjWfyugvigPDcM3KKLDMpybs7WuY6ia33eTzPtydBCrkAghAEAMaDDg0NzkwMjcyNzUyNCIMU0ZdGeUyXrP3cS%2BAKsECrRS0rQ1645z%2F1SjI2gh2nTd5z4HWvh4VO68TdetQudGZhAvWtAbqUi58xbKG10FtENPhIu%2FRxwOeDOF%2BWxXaEFisWKEcruAG1oo4s%2BMn%2BVGJwgIqNrXAG8XfuSviCT68XXPp2YZEnZ4RzFtxNxpsYfkEghpwtbXjATxmwnADyZQ4cogwScgUxZ7HaJkEm%2BSbEmSfj0nJ1AuY%2F%2BmP7AMHSvVA4ut7MaFtOtOb4jtSamsxmAv6JNeCmceGtAdzxXp0KWahWecXII4dR8fhY8ECygj3hQx23d90XBhmzzJvNW9EZj%2BTwSL4N43kjo4Bf9rDUuHdvs5nXHfYy%2B9tDj0P%2FmxE2A06zc8bq3wRHMa6oS5HCz5i2YdxkmcDo%2Fiwf%2FN%2BmzQyH%2FHkmcSUcu%2FQl7qx0M5lvhK91cujDasj8gOOM6hzMKOKr5YGOrIC8ycy1e2b2krfyhpHtYjRX1MkiOQ25oqZDwOZarY1iwrwNrvc%2FPzZoQvY%2FAFrf8%2BfbRUU6yC5RtJVBOzD8Fc207FethWt%2FLpPEHcB8APtM2wX%2FGFbTVUsNyb4zsTGfdgBdzY6HJbho0%2Fqsy7%2F%2FF0FKgInX3FLec3EFK3t%2BD10%2B6O72yO%2BsseBujEiqpOdnJahnUwycc9b4BQcltw3miOr7LOZUKqebSm8wt4z2VPBsTYTl8PMtfYr1%2BXzhTqTnfkgI3V9aYM4zagE4geh5SsJ5Jw%2FVKP8ueONkSylwupnI01PPRjs9KtYHLU7PIXRooUtbU21iK7JHn%2Fp0FmJEa50EhY30lGsB1ZaOaFO%2B2XzEH%2FYnuNCpiXyveUky9Y0h%2FTfd2bLdlGwLEc8sHRoHUqS7lVe&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220711T064152Z&X-Amz-SignedHeaders=host&X-Amz-Expires=300&X-Amz-Credential=ASIA4K2XQ3VSAZXZYFHE%2F20220711%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Signature=553d6bef29fd1c97022ab3a4db0af5505b9b6d89d925ddf7e3745375588c8f62)
88

9-
```bash
10-
# create a new project in the current directory
11-
npm init svelte
9+
## Features
1210

13-
# create a new project in my-app
14-
npm init svelte my-app
15-
```
11+
- Fuzzy search powered by fuse.js
12+
- Run actions conditionally
13+
- Super simple API, just define your actions and it just works!
14+
- Advanced conditional actions - decide whether to run your action based on the current state of your command palette
15+
- Access to `paletteStore` , update your update palette store from anywhere to make updates to your command-palette.
16+
- Keyboard shortcuts - define keyboard shortcuts for your actions!
1617

17-
## Developing
18+
and more
1819

19-
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
20+
## Installation
2021

21-
```bash
22-
npm run dev
22+
Install svelte-command-palette with npm
2323

24-
# or start the server and open the app in a new browser tab
25-
npm run dev -- --open
24+
```bash
25+
npm install svelte-command-palette
2626
```
2727

28-
## Building
28+
## Usage/Examples
2929

30-
To create a production version of your app:
30+
```javascript
31+
<script>
32+
import CommandPalette, { defineActions } from 'svelte-command-palette'
3133

32-
```bash
33-
npm run build
34-
```
34+
// define actions using the defineActions API
35+
36+
const actions = defineActions([
37+
{
38+
id: 1,
39+
title: "Open Svelte Command Palette on github",
40+
subTitle: 'This opens github in a new tab!",
41+
onRun: ({ action, storeProps, storeMethods }) => {
42+
window.open("https://github.com/rohitpotato/svelte-command-palette"),
43+
},
44+
shortcut: "Space k"
45+
}
46+
])
47+
</script>
3548
36-
You can preview the production build with `npm run preview`.
49+
// render your command palette at the root of your application, say _layout.svelte
3750
38-
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
51+
<CommandPalette {actions}>
52+
53+
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"build:docs": "node generateDocSnippets.js",
66
"dev": "npm run build:docs && svelte-kit dev",
77
"build": "npm run build:docs && svelte-kit build",
8-
"package": "svelte-kit package",
8+
"package": "svelte-kit package && cp ./README.md ./package/README.md",
99
"preview": "svelte-kit preview",
1010
"prepare": "svelte-kit sync",
1111
"test": "playwright test",

0 commit comments

Comments
 (0)