Skip to content

Commit 3ded731

Browse files
committed
docs: improve command palettes
1 parent 82adedf commit 3ded731

File tree

5 files changed

+21
-6
lines changed

5 files changed

+21
-6
lines changed

docs/components/content/examples/CommandPaletteExampleBasic.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ const selected = ref([people[3]])
2020
v-model="selected"
2121
multiple
2222
nullable
23+
:autoselect="false"
2324
:groups="[{ key: 'people', commands: people }]"
24-
:fuse="{ resultLimit: 6 }"
25+
:fuse="{ resultLimit: 6, fuseOptions: { threshold: 0.1 } }"
2526
/>
2627
</template>

docs/components/content/examples/CommandPaletteExampleGroups.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ function onSelect (option) {
4242
</script>
4343
4444
<template>
45-
<UCommandPalette ref="commandPaletteRef" :groups="groups" @update:model-value="onSelect" />
45+
<UCommandPalette ref="commandPaletteRef" :groups="groups" :autoselect="false" @update:model-value="onSelect" />
4646
</template>

docs/components/content/themes/CommandPaletteThemeAlgolia.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@ const ui = {
2424
wrapper: 'flex flex-col flex-1 min-h-0 bg-gray-50 dark:bg-gray-800',
2525
input: {
2626
wrapper: 'relative flex items-center mx-3 py-3',
27-
base: 'w-full rounded border-2 border-primary-500 placeholder-gray-400 dark:placeholder-gray-500 focus:border-primary-500 focus:outline-none focus:ring-0 h-14 text-lg bg-white dark:bg-gray-900',
28-
icon: 'pointer-events-none absolute left-3 h-6 w-6 text-primary-500 dark:text-primary-400'
27+
base: 'w-full rounded border-2 border-primary-500 placeholder-gray-400 dark:placeholder-gray-500 focus:border-primary-500 focus:outline-none focus:ring-0 bg-white dark:bg-gray-900',
28+
padding: 'px-4',
29+
height: 'h-14',
30+
size: 'text-lg',
31+
icon: {
32+
base: 'pointer-events-none absolute left-3 text-primary-500 dark:text-primary-400',
33+
size: 'h-6 w-6'
34+
}
2935
},
3036
group: {
3137
wrapper: 'p-3 relative',
@@ -60,6 +66,7 @@ const ui = {
6066
:ui="ui"
6167
:close="close"
6268
:empty="empty"
69+
:autoselect="false"
6370
command-attribute="title"
6471
:fuse="{
6572
fuseOptions: { keys: ['title', 'category'] },

docs/components/content/themes/CommandPaletteThemeRaycast.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,12 @@ const ui = {
5353
</script>
5454

5555
<template>
56-
<UCommandPalette ref="commandPaletteRef" :groups="groups" icon="" :ui="ui" placeholder="Search for apps and commands" />
56+
<UCommandPalette
57+
ref="commandPaletteRef"
58+
:groups="groups"
59+
icon=""
60+
:ui="ui"
61+
:autoselect="false"
62+
placeholder="Search for apps and commands"
63+
/>
5764
</template>

docs/content/4.navigation/2.command-palette.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const selected = ref([people[3]])
4242
multiple
4343
nullable
4444
:groups="[{ key: 'people', commands: people }]"
45-
:fuse="{ resultLimit: 6 }"
45+
:fuse="{ resultLimit: 6, fuseOptions: { threshold: 0.1 } }"
4646
/>
4747
</template>
4848
```

0 commit comments

Comments
 (0)