Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
6598653
feat(VCommandPalette): introduce command palette component
MatthewAry Dec 4, 2025
bc0ba6e
Add missing localizations
MatthewAry Dec 4, 2025
cbe8d53
refactor(VCommandPalette): WIP Navigation Logic
MatthewAry Dec 4, 2025
ae5b0b3
refactor(VCommandPalette): streamline item handling and navigation
MatthewAry Dec 4, 2025
79c4bcf
refactor(VCommandPalette): update localization and documentation
MatthewAry Dec 4, 2025
a842e93
Fix lint
MatthewAry Dec 4, 2025
4016bac
Lint fixes
MatthewAry Dec 4, 2025
4911d22
dirty fix for search
J-Sek Dec 6, 2025
afe7533
types for slots
J-Sek Dec 7, 2025
d79053e
use VSheet instead of VCard, load styles
J-Sek Dec 7, 2025
d8de285
readonly `selectedIndex`
J-Sek Dec 7, 2025
caa42de
refactor: simplify initial focus
J-Sek Dec 7, 2025
ed39599
simplify refs
J-Sek Dec 7, 2025
6876db1
refactor(VCommandPalette): enhance input handling and styling
MatthewAry Dec 8, 2025
80ddb4e
fix(VCommandPalette): add cleanup for hotkey listener on unmount
MatthewAry Dec 8, 2025
94a5cb5
Woops Clean up last commit
MatthewAry Dec 8, 2025
5d7b4aa
fix(VCommandPalette): improve focus handling and item value binding
MatthewAry Dec 16, 2025
ab2f8d6
Make Provide/Inject more aligned with project
MatthewAry Dec 18, 2025
7ef726e
Lint Fixes
MatthewAry Dec 18, 2025
8cc8f22
feat: add `list-props`
J-Sek Dec 19, 2025
d77bf26
docs: describe `list-props` + sort
J-Sek Dec 19, 2025
2408e20
docs: fix usage example
J-Sek Dec 19, 2025
f9eb65f
fix: missing activator slot (+ reorder imports)
J-Sek Dec 19, 2025
3552a3b
fix missing click handler in usage.vue script
J-Sek Dec 19, 2025
aee9c68
docs: fix usage example (drop v-model="dialog")
J-Sek Dec 19, 2025
8c77ac9
refactor(VCommandPalette): remove location prop and update documentation
MatthewAry Jan 6, 2026
ca45f45
fix(VCommandPalette): update default input icon and improve icon set
MatthewAry Jan 6, 2026
ea12b9f
refactor(VCommandPalette): simplify dialog props and enhance icon set
MatthewAry Jan 6, 2026
d5aaa49
feat(VCommandPalette): add max-width prop to examples
MatthewAry Jan 6, 2026
0e9334e
chore: consolidate docs icons
J-Sek Jan 6, 2026
bd221fc
chore: correct defaults
J-Sek Jan 6, 2026
6f09982
chore: input autofocus + suppress autocomplete
J-Sek Jan 6, 2026
03644ec
docs: fix usage example
J-Sek Jan 6, 2026
613b760
chore: extract Sass variables
J-Sek Jan 7, 2026
a7fd2cb
refactor: expose dialog props
J-Sek Jan 7, 2026
b6c995a
feat: pass density to input and list
J-Sek Jan 7, 2026
b4a37ac
fix: keep subheader and dividers when filtering
J-Sek Jan 28, 2026
1cf8c80
fix: avoid showing 2 dividers next to each other
J-Sek Jan 28, 2026
24facd8
feat: additional slots
J-Sek Jan 28, 2026
ddc6254
Merge branch 'dev' into matthewary/v-command-palette-r2
J-Sek Jan 28, 2026
df9d7ed
docs: descriptions for new slots
J-Sek Jan 28, 2026
e516154
docs: options API scripts for new examples
J-Sek Jan 28, 2026
a259e61
chore: drop TS from example
J-Sek Jan 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions packages/api-generator/src/locale/en/VCommandPalette.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"props": {
"modelValue": "Controls the visibility of the command palette dialog. Use `v-model` for two-way binding.",
"search": "The current search query. Use `v-model:search` to control or monitor the search input value.",
"items": "Array of command palette items. Objects should have **title** and optionally **subtitle**, **prependIcon**, **appendIcon**, **prependAvatar**, **appendAvatar**, **hotkey**, **onClick**, **to**, **href**, and **value** properties. Use `type: 'subheader'` with a **title** for section headers, or `type: 'divider'` for visual separators between groups.",
"hotkey": "Global keyboard shortcut to toggle the palette. Accepts hotkey strings like `'ctrl+shift+p'` or `'meta+j'`. The shortcut is automatically registered on mount and cleaned up on unmount.",
"placeholder": "Placeholder text displayed in the search input. Defaults to the `$vuetify.command.search` locale string.",
"inputIcon": "Icon to display at the start of the search input field. Defaults to `'mdi-magnify'`.",
"noDataText": "Text displayed when no items match the current search query. Defaults to `$vuetify.noDataText`.",
"location": "Controls the position of the dialog. Supports values like `'top'`, `'bottom'`, `'center'` and combinations. Passed to the underlying **v-dialog**.",
"activator": "Element to use as the activator. Set to `'parent'` to use the parent element, or provide a CSS selector or element reference. Passed to the underlying **v-dialog**.",
"dialogProps": "Additional props to pass through to the underlying **v-dialog** component. Useful for customizing behavior like `persistent`, `fullscreen`, `width`, `maxWidth`, etc."
},
"events": {
"update:modelValue": "Emitted when the dialog visibility changes.",
"update:search": "Emitted when the search query changes.",
"click:item": "Emitted when an item is clicked or activated via Enter key. The payload includes the selected item object and the triggering event (MouseEvent or KeyboardEvent). The palette automatically closes after this event."
},
"slots": {
"prepend": "Content to render above the search input, inside the command palette card. Useful for headers, breadcrumbs, or instructions.",
"input": "Custom search input field. Replaces the default **v-text-field**. Useful for providing a completely custom search implementation.",
"append": "Content to render below the items list, inside the command palette card. Useful for footers, keyboard shortcut hints, or additional actions.",
"no-data": "Custom content to display when no items match the search query. Replaces the default no-data message."
}
}
7 changes: 4 additions & 3 deletions packages/api-generator/src/locale/en/VList.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@
"update:selected": "Emitted when the list item is selected."
},
"slots": {
"divider": "Slot for the divider.",
"header": "Slot for the header.",
"subheader": "Removes the top padding from `v-list-subheader` components. When used as a **String**, renders a subheader for you.",
"item": "Slot for rendering custom list items. Receives `{ props }` where `props` contains item data (`title`, `subtitle`, `value`, etc.) plus `index` (the item's position in the list). Use this to completely customize item rendering while still using VList's navigation and selection features.",
"divider": "Slot for rendering custom dividers. Receives `{ props }` containing divider item data including `value`. Note: dividers do not receive `index` since they are not navigable items.",
"subheader": "Slot for rendering custom subheaders. Receives `{ props }` containing subheader item data including `title` and `value`. Note: subheaders do not receive `index` since they are not navigable items.",
"header": "Slot for rendering custom group headers when using nested items. Receives `{ props }` containing the group's header item data plus activator props for expand/collapse functionality.",
"children": "Slot for the children.",
"focus": "Slot for the focus.",
"open": "Slot for the open.",
Expand Down
4 changes: 4 additions & 0 deletions packages/docs/src/data/nav.json
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@
"title": "color-inputs",
"subfolder": "components"
},
{
"title": "command-palettes",
"subfolder": "components"
},
{
"title": "date-inputs",
"subfolder": "components"
Expand Down
206 changes: 206 additions & 0 deletions packages/docs/src/examples/v-command-palette/prop-dialog.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
<template>
<v-container fluid>
<v-row>
<v-col cols="12" md="4">
<v-card>
<v-card-title>Default (Center)</v-card-title>
<v-card-text>
<v-btn block @click="dialogs.default = true">
Open Default
</v-btn>
</v-card-text>
</v-card>

<v-command-palette
v-model="dialogs.default"
:items="items"
placeholder="Search..."
@click:item="handleClick"
></v-command-palette>
</v-col>

<v-col cols="12" md="4">
<v-card>
<v-card-title>Top Position</v-card-title>
<v-card-text>
<v-btn block @click="dialogs.top = true">
Open at Top
</v-btn>
</v-card-text>
</v-card>

<v-command-palette
v-model="dialogs.top"
:items="items"
location="top"
placeholder="Search..."
@click:item="handleClick"
></v-command-palette>
</v-col>

<v-col cols="12" md="4">
<v-card>
<v-card-title>Parent Activator</v-card-title>
<v-card-text>
<v-btn block>
Click to Open
<v-command-palette
v-model="dialogs.activator"
:items="items"
activator="parent"
placeholder="Search..."
@click:item="handleClick"
></v-command-palette>
</v-btn>
</v-card-text>
</v-card>
</v-col>
</v-row>

<v-row>
<v-col cols="12">
<v-card>
<v-card-title>Custom Dialog Props</v-card-title>
<v-card-text>
<v-btn block @click="dialogs.custom = true">
Open Persistent (No Close on Click Outside)
</v-btn>
</v-card-text>
</v-card>

<v-command-palette
v-model="dialogs.custom"
:dialog-props="{ persistent: true }"
:items="items"
placeholder="Search..."
@click:item="handleClick"
></v-command-palette>
</v-col>
</v-row>

<v-snackbar v-model="snackbar" :timeout="2000">
Selected: {{ selectedItem }}
</v-snackbar>
</v-container>
</template>

<script setup>
import { ref } from 'vue'

const dialogs = ref({
default: false,
top: false,
activator: false,
custom: false,
})

const snackbar = ref(false)
const selectedItem = ref('')

const items = [
{
title: 'New File',
subtitle: 'Create a new file',
prependIcon: 'mdi-file-plus',
value: 'new-file',
},
{
title: 'New Folder',
subtitle: 'Create a new folder',
prependIcon: 'mdi-folder-plus',
value: 'new-folder',
},
{
title: 'Open',
subtitle: 'Open a file or project',
prependIcon: 'mdi-folder-open',
value: 'open',
},
{
type: 'divider',
},
{
type: 'subheader',
title: 'Recent',
},
{
title: 'Project Alpha',
subtitle: 'Last opened 2 hours ago',
prependIcon: 'mdi-folder',
value: 'project-alpha',
},
{
title: 'Project Beta',
subtitle: 'Last opened yesterday',
prependIcon: 'mdi-folder',
value: 'project-beta',
},
]

function handleClick (item) {
selectedItem.value = item.title
snackbar.value = true
}
</script>

<script>
export default {
data () {
return {
dialogs: {
default: false,
top: false,
activator: false,
custom: false,
},
snackbar: false,
selectedItem: '',
items: [
{
title: 'New File',
subtitle: 'Create a new file',
prependIcon: 'mdi-file-plus',
value: 'new-file',
},
{
title: 'New Folder',
subtitle: 'Create a new folder',
prependIcon: 'mdi-folder-plus',
value: 'new-folder',
},
{
title: 'Open',
subtitle: 'Open a file or project',
prependIcon: 'mdi-folder-open',
value: 'open',
},
{
type: 'divider',
},
{
type: 'subheader',
title: 'Recent',
},
{
title: 'Project Alpha',
subtitle: 'Last opened 2 hours ago',
prependIcon: 'mdi-folder',
value: 'project-alpha',
},
{
title: 'Project Beta',
subtitle: 'Last opened yesterday',
prependIcon: 'mdi-folder',
value: 'project-beta',
},
],
}
},
methods: {
handleClick (item) {
this.selectedItem = item.title
this.snackbar = true
},
},
}
</script>
Loading