shadcn.io is not affiliated with official shadcn/ui
Filter Popovers Navbar Block for React
A board navbar with Priority, Assignee and Label filter popovers that show counts, a Clear filters button, a star toggle and a Board, List and Timeline switch.
Installation
Overview
A board navbar for React with Base UI, the bar of Cardwalk, team boards. A row of cells follows the wordmark: the board's title with a star toggle, then three filter pills, Priority, Assignee and Label. Each pill opens a popover of checkboxes with the number of cards behind every choice. A pill with something ticked wears a count, Clear filters undoes them all, and "13 of 24 cards" (from xl) is worked out from the 24 sample cards in the file: choices in one group add up, and groups narrow each other. A Board, List and Timeline switch closes the bar. Below lg the pills fold into one Filters button with the count, which opens a drawer from the bottom holding the same checkboxes, and on a phone the view switch. A polite line says what each change did, and the bar stays 56 pixels high. It's built from Popover, Checkbox, Field, Badge, Segment Group, Toggle, Drawer, Button and Guides. For boards, trackers and any list that needs filters you can read at a glance.
FAQ
How do the filters combine?
Inside one group any ticked choice matches, so Urgent and High shows both. Across groups every group with a choice must match, so Urgent plus Ana shows the urgent cards that are Ana's. The number beside each choice is how many of the 24 sample cards carry it whatever else is ticked, and the "n of 24 cards" figure is the result of the current filters. The sample is example data in the CODES list: replace it with your own query.
How do the popovers work with a keyboard?
Each pill is a button that reports whether its popover is open. Enter or Space opens it, Tab moves through the checkboxes, Space ticks one, and Escape closes it and returns focus to the pill. The count on a pill is read as part of its name ("Priority 2 selected"). The popovers are not modal: clicking away closes one.
What does Clear filters do, and why is it sometimes invisible?
It clears every group at once and says so. It is always in the layout but invisible and disabled while nothing is ticked, so the pills don't move when a filter appears.
What does the view switch do?
It chooses Board, List or Timeline and says which is on in a polite line. It doesn't draw the board: put your own view components behind the view state. From md it sits in the bar as a segment group; on a phone it is the last group in the drawer.
How does it fit on a phone?
Below lg the pills hide and a Filters button, with the number ticked, opens a drawer from the bottom: three groups in two columns, the view switch below md, and Clear filters. The board's title and star stay in the bar at every width, and the wordmark is its icon until xl.
The drawer closes on Escape and focus returns to Filters.
Related
- Pro
Contextual Navbar
Cells and splitsA navbar with a Site | App segment control whose two link sets and action sets cross-fade in one grid cell, so the bar's width and height never change.
- Pro
Segmented Control Navbar
Link highlightsA navbar for a meal-planning app that centres its three destinations in a tray of equal segments, each an icon, a label and a count, with one raised thumb that slides under the current one and folds to icons on a phone.
- Pro
Calendar View Navbar
App toolbarsA calendar navbar for a shared scheduling app that moves a day, week, month or agenda label with Today, previous and next.
- Pro
Settings Header Navbar
Two rowsA two-row settings header: the page title and one real edit (a Weekly digest switch) with Discard and Save that wake up when it changes, and a row of section tabs where the dirty one carries a dot and a spoken note.
- Pro
Category Chips Navbar
Two rowsA two-row shop navbar: wordmark, a search that jumps to a category and account and bag links on top, and below a strip of category chips with counts that snap-scrolls with edge fades and brings the current chip into view.
- Pro
Environment Switcher Navbar
Accounts and scopesAn app bar with a Production, Staging and Development segment control that shows the environment's base URL with a copy button and asks for confirmation before switching to Production.