Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Combobox examples · Custom Actions

With Quick Filters Combobox for React

A combobox with filter buttons above the list that narrow it to one category.

Framework
UI library

An issue picker with All, Bugs, Features and Docs buttons between the search box and the list. A button narrows the list to its category and the search works within it. Use it for long lists with a few clear categories, where a filter is quicker than typing.

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 are the filter buttons built?

Small pill Buttons in a row with border-b p-2. The active one uses the default variant and the rest are outline, and each sets aria-pressed.

How does a button set the filter?

It stores its category, read from a data-category attribute, in state. All stores an empty category, which shows everything.

How do the filter and the search combine?

The items are narrowed to the category first, then the search filters what's left. The narrowed list is passed as items, and the combobox filters it by the search.

Which issues are listed?

Bug Report and Critical Bug (Bugs), Feature Request and New Feature (Features), and Documentation (Docs). No item found. shows when nothing matches.

Does the filter reset when the list closes?

No, it's kept in state, so the next open shows the same category. Reset it when the list closes if that's confusing.

What does the button show?

The picked issue, or Select item... before a pick.