Skip to content

shadcn.io is an independent project built on shadcn/ui

Free

Command Popover Actions Menu for Ark UI

An outline Quick Actions button that opens a popover of file actions, each with an icon and a shortcut.

An outline Quick Actions button opens the popover. It lists Open, Copy, Add to Favorites, Download, Share, and Delete, split into Quick Actions and File Actions, each with an icon and a shortcut.

Use it when the actions should stay beside the button. Cover the page with a Dialog when the list needs the full width. In React, Ark UI does not carry out the command.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

Anatomy

Command anatomy: root, input, group label, list, item, shortcut

Usage

<CommandItem item={item} key={item.value}>
  <Icon aria-hidden="true" />
  <span>{item.label}</span>
  <CommandShortcut>{item.shortcut}</CommandShortcut>
</CommandItem>

FAQ

How is this menu anchored to the button?

The Quick Actions button is the trigger, and the panel opens below it, lined up with its start edge. The panel is 400px wide, never wider than the screen, and has no padding, so the Command fills it. A visually hidden PopoverTitle names it. PopoverTrigger takes the button with asChild, and positioning on Popover sets placement: "bottom-start". When the popover closes, the demo clears the filter.

How are the actions grouped?

Two CommandGroups: Quick Actions holds Open, Copy and Add to Favorites, and File Actions holds Download, Share and Delete. There is no separator, so the headings alone split them. Each row starts with a decorative icon: ArrowRight, Copy, Star, Download, Share or Trash.

Where do the key hints come from?

Each hint is a CommandShortcut: Open shows ↵, Copy ⌘C, Add to Favorites ⌘D, Download ⌘⇧D, Share ⌘⇧S and Delete ⌘⌫. It's a label at the end of the row and binds nothing: listen for those keys yourself if they should run the action.

What appears when nothing matches the search?

CommandEmpty in the list says "No actions found." It shows only when the search leaves nothing.

How do I run an item from this menu in React?

These items don't run anything yet. Handle onValueChange on Command, which receives the chosen item's value, and keep value empty so every choice fires.

How do the keys work in this menu?

The arrow keys move through the items, Enter runs the highlighted one, and typing filters the list. Escape or a click outside closes the popover, and focus goes back to the button. CommandInput shows "Search actions..." until someone types. The filtering is the demo's: it builds the items with useListCollection and a contains filter, and calls filter with the input's value as it changes.

API Reference

Command

Sets item={item}. The rest is on the Command page.