Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Command Search Awards Block for React

An inline command window that searches twelve awards and six programmes by name, programme, category or year, with matches marked and a live result count.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A searchable awards window for React with Base UI. A short header and a hint sit at the start of a split; a divider separates them from a framed command window at the end; on a phone the window comes under the header. The window is the catalog Command: a search field that matches an award's name, its programme, its category or its year, and two groups, "Awards" (twelve) and "Programmes" (six, each with how many awards it gave). Each row has a small drawn mark in your theme's foreground, the letters that match are marked, the arrow keys move and Enter opens a row, and a search that matches nothing says so. Key hints and a result count run along the foot, and the count is spoken a moment after typing stops. There is no preview pane: opening a row says so in the foot, in this demo. The awards and programmes are made up for the example: swap AWARDS for your own.

FAQ

How do I change the awards?

Edit AWARDS at the top of the file: each has a title, a programme, a category, a fixed year and a mark (crown, cup, gem, medal, shield or star). The programmes group is built from them, in the order they first appear, with the number of awards each gave. The search looks in each row's keywords: for an award its name, programme, category and year, for a programme its name.

How is the count announced?

The visible count ("5 results") sits in the foot and is hidden from assistive technology. A separate polite status line, in the page from the start and empty, is filled 600 milliseconds after typing stops, so a screen reader hears the count once rather than on every key, and hears what was opened when a row is chosen.

How does it differ between targets?

The Command filters nothing itself (shouldFilter={false}): the block filters the groups with the same substring match and passes the typed text in value.

Does the search field grab focus?

No. An open command normally focuses its field as it mounts, which would steal focus and scroll the page, so the block does not let it: the field is focused by the reader, by tabbing or clicking.

Are these real awards?

No. Findlay is a made-up search tool and Yarrowthwaite, Gildenmere, Wynstead, Bramblethwaite, Cresswold and Barleyfold are made-up programmes. Choosing a row does nothing beyond saying so in the foot.

  • Pro

    Spotlight Dialog Awards

    Reveal and browse

    A 3 by 2 grid of award tiles that each open one centred dialog with the full details, a counter and Previous and Next, with arrow keys cycling.

  • Pro

    Filterable Award List

    Filters and search

    Eighteen awards in two columns narrowed by category chips and a year group, with a live count, a Clear filters button and an empty state.

  • Pro

    Searchable Archive Awards

    Filters and search

    A decade of awards in a table of eight rows a page, with a search field, a year Select, a live Showing 1 to 8 of 29 line and the catalog Pagination.

  • Pro

    Tooltip Grid Awards

    Badges and seals

    Twenty-four awards as a tiny grid of drawn marks with no text, each opening a tooltip on hover, focus or tap, with one tab stop and arrow-key movement.

  • Pro

    Command Palette Search Team

    Lists and directories

    A people palette in a framed window for a team wiki: a live command box over twelve people and four teams, matched letters marked, arrow keys to move, and the highlighted entry's profile with its local time beside the list.

  • Pro

    A live command menu for a workflow launcher: a search field that filters nine actions in three groups, with a preview pane that shows what the highlighted action will do.