BlogPlaygroundOne

VCommandPalette API


Props
name
type
default
boolean
false

Applies position: absolute to the content element.

Element | (string & {}) | 'parent' | ComponentPublicInstance
undefined

Explicitly sets the overlay’s activator.

unknown
{}

Apply custom properties to the activator.

string | boolean | Element
false

Specifies which DOM element the overlay content should teleport to. Can be a direct element reference, querySelector string, or true to disable teleporting. Uses body by default.

boolean
true

When enabled, focus will be trapped within the component’s content, preventing Tab navigation from moving focus outside. Useful for modals, dialogs, and overlays to maintain accessibility.

string | number
undefined

Milliseconds to wait before closing component. Only applies to hover and focus events.

boolean
true

Closes the overlay content when the browser’s back button is pressed or $router.back() is called, cancelling the original navigation. persistent overlays will cancel navigation and animate as if they were clicked outside instead of closing.

boolean
false

Closes component when you click on its content.

boolean
true

Controls whether the palette closes automatically after selecting an actionable item. Set to false to keep it open for external drill-in and nested navigation flows.

boolean
false

Limits the size of the component and scrim to its offset parent. Implies absolute and attach. (Note: The parent element must have position: relative.).

any
undefined

Applies a custom class to the detached element. This is useful because the content is moved to the beginning of the v-app component (unless the attach prop is provided) and is not targetable by classes passed directly on the component.

any
undefined

Apply custom properties to the content.

FilterFunction
undefined

Function used to filter items, called for each filterable key on each item in the list. The first argument is the filterable value from the item, the second is the search term, and the third is the internal item object. The function should return true if the item should be included in the filtered list, or the index of the match in the value if it should be included with the result highlighted.

unknown
undefined

Function used on specific keys within the item object. customFilter is skipped for columns with customKeyFilter specified.

'default' | 'comfortable' | 'compact'
'default'

Adjusts the vertical height used by the component.

boolean
false

Removes the ability to click or target the component.

boolean
false

Forces the component’s content to render when it mounts. This is useful if you have content that will not be rendered in the DOM that you want crawled for SEO.

string | string[]
['title', 'subtitle']

Array of specific keys to filter on the item.

'every' | 'some' | 'union' | 'intersection'
'intersection'

Controls how the results of customFilter and customKeyFilter are combined. All modes only apply customFilter to columns not specified in customKeyFilter.

  • some: There is at least one match from either the custom filter or the custom key filter.
  • every: All columns match either the custom filter or the custom key filter.
  • union: There is at least one match from the custom filter, or all columns match the custom key filters.
  • intersection: There is at least one match from the custom filter, and all columns match the custom key filters.
boolean
false

Changes layout for fullscreen display.

string | number
undefined

Sets the height for the component.

string
undefined

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.

string
'$search'

Icon to display at the start of the search input field.

(
  | {
      type: 'item'
      onClick: (event: MouseEvent | KeyboardEvent, value: any) => void
      value: any
      hotkey: string
      title: string
      subtitle: string
      prependIcon: string
      appendIcon: string
      prependAvatar: string
      appendAvatar: string
      to: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric
      href: string
    }
  | { type: 'subheader'; title: string; inset: boolean }
  | { type: 'divider'; inset: boolean }
)[]
[]

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.

unknown
undefined

Pass props through to the v-list component. Accepts an object with anything from v-list props, camelCase keys are recommended.

Anchor
'bottom'

Specifies the anchor point for positioning the component, using directional cues to align it either horizontally, vertically, or both…

'static' | 'connected' | LocationStrategyFunction
'static'

A function used to specifies how the component should position relative to its activator.

string | number
undefined

Sets the maximum height for the component.

string | number
500

Sets the maximum width for the component.

string | number
undefined

Sets the minimum height for the component.

string | number
undefined

Sets the minimum width for the component.

boolean
false

Controls the visibility of the command palette dialog. Use v-model for two-way binding.

boolean
false

Disables the bounce effect when clicking outside of the content element when using the persistent prop.

string
'$vuetify.noDataText'

Text displayed when no items match the current search query.

boolean
false

Disables all item filtering.

string | number | number[]
undefined

Increases distance from the target. When passed as a pair of numbers, the second value shifts anchor along the side and away from the target.

string | number
undefined

Sets the opacity of the scrim element. Only applies if scrim is enabled.

string | number
undefined

Milliseconds to wait before opening component. Only applies to hover and focus events.

boolean
undefined

Activate the component when the activator is clicked.

boolean
undefined

Activate the component when the activator is focused.

boolean
false

Activate the component when the activator is hovered.

Anchor | 'auto' | 'overlap'
'center center'

Sets the transition origin on the element. You can find more information on the MDN documentation for transition origin.

boolean
false

Clicking outside of the element or pressing esc key will not deactivate it.

string
'$vuetify.command.search'

Placeholder text displayed in the search input.

boolean
true

Captures and keeps focus within the content element when using Tab and Shift+Tab. Recommended to be false when using external tools that require focus such as TinyMCE or vue-clipboard.

string | boolean
true

Accepts true/false to enable background, and string to define color.

boolean
false

When set to true, expects a v-card and a v-card-text component with a designated height. For more information, check out the scrollable example.

'close' | 'block' | 'none' | 'reposition' | ScrollStrategyFunction
'block'

Strategy used when the component is activate and user scrolls.

string
undefined

The current search query. Use v-model:search to control or monitor the search input value.

boolean
false

Enables the overlay content to go off-screen when scrolling.

  | Element
  | (string & {})
  | 'parent'
  | 'cursor'
  | ComponentPublicInstance
  | [number, number]
undefined

For locationStrategy=“connected”, specify an element or array of x,y coordinates that the overlay should position itself relative to. This will be the activator element by default.

string
undefined

Specify a theme for this component and all of its children.

  | string
  | boolean
  | (TransitionProps & { component: Component })
  | {
      component: ComponentPublicInstanceConstructor<
        CreateComponentPublicInstanceWithMixins<
          {} & { target?: HTMLElement | [x: number, y: number] | undefined } & {
            $children?:
              | VNodeChild
              | { $stable?: boolean | undefined }
              | (() => VNodeChild)
              | { default?: (() => VNodeChild) | undefined }
            'v-slots'?:
              | { default?: false | (() => VNodeChild) | undefined }
              | undefined
          } & { 'v-slot:default'?: false | (() => VNodeChild) | undefined },
          () => JSX.Element,
          unknown,
          {},
          {},
          ComponentOptionsMixin,
          ComponentOptionsMixin,
          Record<string, any>,
          PublicProps,
          {},
          true,
          {},
          SlotsType<Partial<MakeSlots<{ default: never }>>>,
          GlobalComponents,
          GlobalDirectives,
          string,
          {},
          any,
          ComponentProvideOptions,
          OptionTypesType<{}, {}, {}, {}, {}, {}>,
          {} & { target?: HTMLElement | [x: number, y: number] | undefined } & {
            $children?:
              | VNodeChild
              | { $stable?: boolean | undefined }
              | (() => VNodeChild)
              | { default?: (() => VNodeChild) | undefined }
            'v-slots'?:
              | { default?: false | (() => VNodeChild) | undefined }
              | undefined
          } & { 'v-slot:default'?: false | (() => VNodeChild) | undefined },
          () => JSX.Element,
          {},
          {},
          {},
          {}
        >,
        any,
        any,
        any,
        ComputedOptions,
        MethodOptions
      > &
        ComponentOptionsBase<
          {} & { target?: HTMLElement | [x: number, y: number] | undefined } & {
            $children?:
              | VNodeChild
              | { $stable?: boolean | undefined }
              | (() => VNodeChild)
              | { default?: (() => VNodeChild) | undefined }
            'v-slots'?:
              | { default?: false | (() => VNodeChild) | undefined }
              | undefined
          } & { 'v-slot:default'?: false | (() => VNodeChild) | undefined },
          () => JSX.Element,
          unknown,
          {},
          {},
          ComponentOptionsMixin,
          ComponentOptionsMixin,
          Record<string, any>,
          string,
          {},
          {},
          string,
          SlotsType<Partial<MakeSlots<{ default: never }>>>,
          GlobalComponents,
          GlobalDirectives,
          string,
          ComponentProvideOptions
        > &
        VNodeProps &
        AllowedComponentProps &
        ComponentCustomProps & {
          filterProps: (props: T) => Partial<Pick<T, U>>
        }
    }
{component: {name: 'VDialogTransition'}}

Sets the component transition. Can be one of the built in or custom transition.

string | number
12

Sets custom viewport margin for the overlay content

string | number
undefined

Sets the width for the component.

string | number
2400

The z-index used for the component.

Events
name
type
[
  {
    item:
      | {
          type: 'item'
          onClick: (event: MouseEvent | KeyboardEvent, value: any) => void
          value: any
          hotkey: string
          title: string
          subtitle: string
          prependIcon: string
          appendIcon: string
          prependAvatar: string
          appendAvatar: string
          to:
            | string
            | RouteLocationAsRelativeGeneric
            | RouteLocationAsPathGeneric
          href: string
        }
      | { type: 'subheader'; title: string; inset: boolean }
      | { type: 'divider'; inset: boolean }
    event: MouseEvent | KeyboardEvent
    preventDefault: () => void
  },
]

Emitted before the default auto-close behavior for actionable item selection. The payload includes the selected item, the triggering event, and a preventDefault callback. Call preventDefault() to keep the palette open.

[
  (
    | {
        type: 'item'
        onClick: (event: MouseEvent | KeyboardEvent, value: any) => void
        value: any
        hotkey: string
        title: string
        subtitle: string
        prependIcon: string
        appendIcon: string
        prependAvatar: string
        appendAvatar: string
        to: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric
        href: string
      }
    | { type: 'subheader'; title: string; inset: boolean }
    | { type: 'divider'; inset: boolean }
  ),
  MouseEvent | KeyboardEvent,
]

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).

[boolean]

Emitted when the dialog visibility changes.

[string]

Emitted when the search query changes.

Slots
{ isActive: boolean props: Record<string, any> targetRef: TemplateRef }
never
never
never
never
{ item: | { type: 'item' onClick: (event: MouseEvent | KeyboardEvent, value: any) => void value: any hotkey: string title: string subtitle: string prependIcon: string appendIcon: string prependAvatar: string appendAvatar: string to: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric href: string } | { type: 'subheader'; title: string; inset: boolean } | { type: 'divider'; inset: boolean } index: number }
{ item: | { type: 'item' onClick: (event: MouseEvent | KeyboardEvent, value: any) => void value: any hotkey: string title: string subtitle: string prependIcon: string appendIcon: string prependAvatar: string appendAvatar: string to: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric href: string } | { type: 'subheader'; title: string; inset: boolean } | { type: 'divider'; inset: boolean } index: number }
{ item: | { type: 'item' onClick: (event: MouseEvent | KeyboardEvent, value: any) => void value: any hotkey: string title: string subtitle: string prependIcon: string appendIcon: string prependAvatar: string appendAvatar: string to: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric href: string } | { type: 'subheader'; title: string; inset: boolean } | { type: 'divider'; inset: boolean } index: number }
{ item: | { type: 'item' onClick: (event: MouseEvent | KeyboardEvent, value: any) => void value: any hotkey: string title: string subtitle: string prependIcon: string appendIcon: string prependAvatar: string appendAvatar: string to: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric href: string } | { type: 'subheader'; title: string; inset: boolean } | { type: 'divider'; inset: boolean } index: number }
never
{ props: { title: string; value: any; [string]: any } }
never
never

When used, will activate the component when clicked (or hover for specific components). This manually stops the event propagation. Without this slot, if you open the component through its model, you will need to manually stop the event propagation.

Content to render below the items list, inside the command palette card. Useful for footers, keyboard shortcut hints, or additional actions.

The default Vue slot.

Custom search input field. Replaces the default v-text-field. Useful for providing a completely custom search implementation.

Content appended inside the search input field. Useful for adding icons or buttons within the input.

Define a custom item appearance.

Content to display after each item’s title, replaces hotkey (if provided).

Content to display before each item’s title.

Slot for customizing the title of each item.

Content to prepend to the list component.

Slot for customizing the rendering of subheader items in the list.

Custom content to display when no items match the search query. Replaces the default no-data message.

Content to render above the search input, inside the command palette card. Useful for headers, breadcrumbs, or instructions.