Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Combobox examples · Rich Content

Items with Action Buttons Combobox for React

A combobox of repositories where each row also has a button that opens the repository.

Framework
UI library

A repository picker with a second action on every row. Picking a row selects the repository, and the small external-link button at the end opens it in a new tab without selecting it. Use it where people may want to check an option before choosing it.

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 each row laid out?

ComboboxItem gets items-start gap-2 py-3. The name in font-medium and the description in muted text-xs fill the row, and the button sits at the end.

What is the button?

A ghost icon-xs Button with an ExternalLinkIcon and an aria-label such as Open awesome-project. The URL is on its data-url attribute.

Why doesn't the button select the row?

Its click handler calls stopPropagation, so the click never reaches the item.

Then it opens the URL in a new tab.

Can the button be reached from the keyboard?

Not with the arrow keys, which move between rows. Enter on a row selects it. If the second action matters to keyboard users, offer it somewhere else too, such as after the pick.

What does the button show after a pick?

The repository name, or Select repository... before one is picked.