Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Combobox examples · Custom Actions

Keyboard Shortcuts Displayed Combobox for React

A combobox of editing commands with each one's keyboard shortcut at the end of the row.

Framework
UI library

A command picker where every row shows its shortcut: Copy ⌘C, Paste ⌘V, Cut ⌘X, Undo ⌘Z and Redo ⌘⇧Z. The shortcut sits at the end of the row in a Kbd. Use it for command menus, so people learn the shortcut while they pick.

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.

FAQ

How is the shortcut placed?

ComboboxItem gets justify-between gap-2, so the command name sits at the start and the Kbd at the end, before the check.

Where do the shortcuts come from?

Each command keeps its shortcut in the data as text, such as ⌘C.

Do the shortcuts work?

No, they're labels. The combobox doesn't listen for those keys. Register the shortcuts in your app if they should run the commands.

What about Windows and Linux?

The ⌘ symbol is for macOS. Show Ctrl+C and so on elsewhere, picking the text from the platform.

What does the button show?

The picked command, or Select command... before a pick.