kliping.pro
  • Docs
  • Explore
  • Builder
  • Directory
  • Colors
  • Typeset
Saved
Docs
  • Sections13
  • Installation5
  • Dark Mode4
  • Forms3
  • Registry6
  • Utilities2
  • More10
  • Components137
  • Accordion
  • Action Bar
  • AI Chat
  • AI Thread List
  • Alert
  • Alert Dialog
  • Angle Slider
  • Animated Grid Pattern
  • Aspect Ratio
  • Attachment
  • Avatar
  • Avatar Group
  • Badge
  • Badge Overflow
  • Banner
  • Border Beam
  • Breadcrumb
  • Bubble
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Checkbox Group
  • Chip
  • Circular Progress
  • Client Only
  • Collapsible
  • Color Picker
  • Color Swatch
  • Combobox
  • Combobox Advanced
  • Command
  • Compare Slider
  • Composition
  • Context Menu
  • Cropper
  • Data Grid
  • Data Table
  • Data Table Advanced
  • Date Picker
  • Dialog
  • Direction Provider
  • Dot Pattern
  • Drawer
  • Dropdown Menu
  • Editable
  • Empty
  • Field
  • File Upload
  • Form
  • FPS
  • Gauge
  • Hitbox
  • Hover Card
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kanban
  • Kbd
  • Kbd Advanced
  • Key Value
  • Label
  • List
  • Listbox
  • Logos
  • Map
  • Marker
  • Marquee
  • Mask Input
  • Masonry
  • Media Player
  • Mention
  • Menubar
  • Message
  • Message Scroller
  • Native Select
  • Navigation Menu
  • Number Field
  • Pagination
  • Particles
  • Pending
  • Phone Input
  • Pin Input
  • Popover
  • Portal
  • Presence
  • Progress
  • QR Code
  • Questionnaire
  • Radio Group
  • Range Calendar
  • Rating
  • Relative Time Card
  • Resizable
  • Responsive Dialog
  • Scroll Area
  • Scroll Spy
  • Scroller
  • Segmented Input
  • Select
  • Selection Toolbar
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Software Purchase Card
  • Sonner
  • Sortable
  • Speed Dial
  • Spinner
  • Stack
  • Stat
  • Status
  • Stepper
  • Stepper Advanced
  • Swap
  • Switch
  • Table
  • Tabs
  • Tags Input
  • Tags Input Advanced
  • Textarea
  • Time Picker
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Tour
  • Typography
  • Visually Hidden
  • Visually Hidden Input
  1. Docs
  2. Components
  3. Command

Command

PreviousNext

Menu perintah untuk Vue yang cepat, bisa dikomposisikan, dan tanpa style bawaan.

Docs API Reference
Suggestions
Calendar
Search Emoji
Calculator
Settings
Profile⌘P
Billing⌘B
Settings⌘S

Installation ​

pnpm dlx kliping@latest add command

Pasang dependensi berikut:

pnpm add reka-ui

Salin dan tempel kode sumber di GitHub ke project Anda.

Sesuaikan path import dengan struktur project Anda.

Usage ​

vue
<script setup lang="ts">
import {
  Command,
  CommandDialog,
  CommandEmpty,
  CommandGroup,
  CommandInput,
  CommandItem,
  CommandList,
  CommandSeparator,
  CommandShortcut,
} from '@/components/ui/command'
</script>

<template>
  <Command>
    <CommandInput placeholder="Type a command or search..." />
    <CommandList>
      <CommandEmpty>No results found.</CommandEmpty>
      <CommandGroup heading="Suggestions">
        <CommandItem>Calendar</CommandItem>
        <CommandItem>Search Emoji</CommandItem>
        <CommandItem>Calculator</CommandItem>
      </CommandGroup>
      <CommandSeparator />
      <CommandGroup heading="Settings">
        <CommandItem>Profile</CommandItem>
        <CommandItem>Billing</CommandItem>
        <CommandItem>Settings</CommandItem>
      </CommandGroup>
    </CommandList>
  </Command>
</template>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

Requirements ​

Semua dipasang otomatis oleh kliping add; tabel ini untuk Anda yang memasang manual atau memeriksa project.

RequirementValue
ProjectVue 3.5+, Tailwind CSS v4, alias @ — disiapkan kliping init
npm packages@lucide/vue@^1.31.0, @vueuse/core@^14.4.0, reka-ui@^2.10.3
Kliping itemsdialog
Filescomponents/ui/command/command.vue
components/ui/command/command-dialog.vue
components/ui/command/command-empty.vue
components/ui/command/command-group.vue
components/ui/command/command-input.vue
components/ui/command/command-item.vue
components/ui/command/command-list.vue
components/ui/command/command-separator.vue
components/ui/command/command-shortcut.vue
components/ui/command/index.ts

Anatomy ​

Susunan bagiannya seperti dipakai di contoh-contoh di atas. Impor semua bagian dari satu tempat, lalu susun begini:

vue
<Command>
  <CommandInput />
  <CommandList>
    <CommandEmpty />
    <CommandGroup>
      <CommandItem>
        <CommandShortcut />
      </CommandItem>
    </CommandGroup>
    <CommandSeparator />
  </CommandList>
</Command>

Bagian lain yang tersedia: CommandDialog.

API Reference ​

Command ​

PropTypeDefaultDescription
modelValue?AcceptableValue | AcceptableValue[]""The controlled value of the listbox. Can be binded with v-model.
defaultValue?AcceptableValue | AcceptableValue[]—The value of the listbox when initially rendered. Use when you do not need to control the state of the Listbox
multiple?boolean—Whether multiple options can be selected or not.
orientation?DataOrientation—The orientation of the listbox.
Mainly so arrow navigation is done accordingly (left & right vs. up & down)
dir?Direction—The reading direction of the listbox when applicable.
If omitted, inherits globally from ConfigProvider or assumes LTR (left-to-right) reading mode.
disabled?boolean—When true, prevents the user from interacting with listbox
selectionBehavior?"replace" | "toggle"—How multiple selection should behave in the collection.
highlightOnHover?booleantrueWhen true, hover over item will trigger highlight
by?string | ((a: AcceptableValue, b: AcceptableValue) => boolean)—Use this to compare objects by a particular field, or pass your own comparison function for complete control over how objects are compared.
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
name?string—The name of the field. Submitted with its owning form as part of a name/value pair.
required?boolean—When true, indicates that the user must set the value before the owning form can be submitted.
EventPayloadDescription
@update:modelValue[value: AcceptableValue]Emitted when the value changes.
@highlight[payload: { ref: HTMLElement; value: AcceptableValue; } | undefined]Emitted when the highlighted item changes, by pointer or keyboard.
@entryFocus[event: CustomEvent<any>]Emitted when focus enters the group; call event.preventDefault() to skip focusing the first item.
@leave[event: Event]Emitted when the pointer leaves the list.
SlotProps
#default—
Data attributeValue
[data-slot]"command"

CommandDialog ​

PropTypeDefaultDescription
open?boolean—The controlled open state of the dialog. Can be binded as v-model:open.
defaultOpen?boolean—The open state of the dialog when it is initially rendered. Use when you do not need to control its open state.
modal?boolean—The modality of the dialog When set to true,
interaction with outside elements will be disabled and only dialog content will be visible to screen readers.
unmountOnHide?boolean—When set to false, the dialog content will not be unmounted when closed, but instead hidden with CSS.
Useful for SEO or when you want to improve performance by not remounting the component on every open.
title?string"Command Palette"Dialog title, visually hidden and read by screen readers.
description?string"Search for a command to run..."Dialog description, visually hidden and read by screen readers.
EventPayloadDescription
@update:open[value: boolean]Emitted when the open state changes.
SlotProps
#default{ open: boolean; close: () => void; }

CommandEmpty ​

PropTypeDefaultDescription
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
SlotProps
#default—
Data attributeValue
[data-slot]"command-empty"

CommandGroup ​

PropTypeDefaultDescription
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
heading?string—Label shown above the group's items; omitted when empty.
SlotProps
#default—
Data attributeValue
[data-slot]"command-group"

CommandInput ​

PropTypeDefaultDescription
modelValue?string—The controlled value of the filter. Can be binded with v-model.
autoFocus?boolean—Focus on element when mounted.
disabled?boolean—When true, prevents the user from interacting with item
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
Data attributeValue
[data-slot]"command-input-wrapper"

CommandItem ​

PropTypeDefaultDescription
valueAcceptableValue—The value given as data when submitted with a name.
disabled?boolean—When true, prevents the user from interacting with the item.
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
EventPayloadDescription
@select[event: SelectEvent$3<AcceptableValue>]Emitted when it is selected, by pointer or keyboard; call event.preventDefault() to keep the menu open.
SlotProps
#default—
Data attributeValue
[data-slot]"command-item"

CommandList ​

PropTypeDefaultDescription
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
SlotProps
#default—
Data attributeValue
[data-slot]"command-list"

CommandSeparator ​

PropTypeDefaultDescription
orientation?DataOrientation—Orientation of the component. Either vertical or horizontal. Defaults to horizontal.
decorative?booleantrueWhether or not the component is purely decorative.
When true, accessibility-related attributes are updated so that that the rendered element is removed from the accessibility tree.
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
SlotProps
#default—
Data attributeValue
[data-slot]"command-separator"

CommandShortcut ​

SlotProps
#default—
Data attributeValue
[data-slot]"command-shortcut"

Keyboard Interactions ​

Perilaku keyboard-nya datang dari primitif Reka UI Listbox yang dipakai komponen ini, mengikuti pola WAI-ARIA.

KeyDescription
EnterWhen highlight on ListboxItem, selects the focused item.
ArrowDownWhen focus is on ListboxItem, moves focus to the next item.
ArrowUpWhen focus is on ListboxItem, moves focus to the previous item.
HomeMoves focus and highlight to the first item.
EndMoves focus and highlight to the last item.
Ctrl/Cmd + ASelect all the items.

CSS Variables ​

Token tema yang dibaca komponen ini — ubah nilainya di CSS global (:root dan .dark, lihat Theming) untuk mengubah tampilannya tanpa menyentuh komponennya: --accent, --accent-foreground, --border, --foreground, --muted-foreground, --popover, --popover-foreground, --radius.

Changelog ​

  • 19 Okt 2026 · Fixed — Aksesibilitas: nama aksesibel dan peran ARIA yang sah.

Credits ​

Berasal dari shadcn-vue (MIT, Copyright (c) 2023 unovue). Rantai lengkapnya di Credits.

PreviousCombobox AdvancedNext Compare Slider

On This Page

InstallationUsageRequirementsAnatomyAPI ReferenceCommandCommandDialogCommandEmptyCommandGroupCommandInputCommandItemCommandListCommandSeparatorCommandShortcutKeyboard InteractionsCSS VariablesChangelogCredits

© 2026 Kliping. Free components are open source under the MIT License.

LicenseCreditsRoadmap