1 ---
2 generate_toc: true
3 ---
4
5 import { ComponentExample } from "@/components/ComponentExample"
6 import { ComponentReference } from "@/components/ComponentReference"
7
8 export const metadata = {
9 title: `Command Bar`,
10 }
11
12 # {metadata.title}
13
14 A component that displays a command bar with a list of commands to perform on a bulk selection of items.
15
16 In this guide, you'll learn how to use the Command Bar component.
17
18 <ComponentExample name="command-bar-demo" />
19
20 ## Usage
21
22 ```tsx
23 import { CommandBar } from "@medusajs/ui"
24 ```
25
26 ```tsx
27 <CommandBar open={open}>
28 <CommandBar.Bar>
29 <CommandBar.Value>{count} selected</CommandBar.Value>
30 <CommandBar.Seperator />
31 <CommandBar.Command
32 action={onDelete}
33 label="Delete"
34 shortcut="d"
35 />
36 <CommandBar.Seperator />
37 <CommandBar.Command
38 action={onEdit}
39 label="Edit"
40 shortcut="e"
41 />
42 </CommandBar.Bar>
43 </CommandBar>
44 ```
45
46 ---
47
48 ## API Reference
49
50 <ComponentReference mainComponent="CommandBar" componentsToShow={[
51 "CommandBar",
52 "CommandBar.Bar",
53 "CommandBar.Value",
54 "CommandBar.Seperator",
55 "CommandBar.Command"
56 ]} hideFeedback />
57