Adding a filtersimilar to
Airtable
The filter pattern of spreadsheet-style databases, rebuilt on a 24-row projects table. A popover under the Filter button holds a list of conditions, each one a field, an operator that fits the field type and a value. The grid filters as you type, the button says what is filtering, and the filtered columns are tinted so the result explains itself.
Every screen
The 5 steps in order. Pick one to open it in the preview above.
Installation
Part of shadcn/ui Pro
Pro unlocks one-command install of every flow in Radix UI, Base UI and React Aria, plus all 507 blocks, the Figma kit, themes and the MCP server for your AI editor.
Part of shadcn/ui Pro
Pro unlocks one-command install of every flow in Radix UI, Base UI and React Aria, plus all 507 blocks, the Figma kit, themes and the MCP server for your AI editor.
Why this flow works
A condition builder for a data grid: describe the rows you want in plain words or add "Where field operator value" rows, joined by and/or, with the grid, counts and filtered columns updating live.
Conditions, not a fixed set of chips
Every field can be filtered, so the panel builds sentences instead of offering preset chips: "Where Duration > 60 and Progress ≥ 50". Use this when users filter on many columns; use chips when there are three or four common filters.
Operators follow the field type
Text gets contains and is, numbers get =, <, ≥, statuses and people get is and is not with a picker, dates get before and after, and every type has is empty. Changing the field resets the operator and value, so a row is never in an impossible state.
Live results, half-built rows ignored
The grid, the row count in the footer and the "8 of 24 projects" line in the panel update on every keystroke. A row without a value is shown but does not filter yet, so adding a condition never empties the grid by surprise.
The filter is always visible
Once a condition applies, the toolbar button reads "Filtered by Duration, Progress" on a tinted background and the filtered columns are tinted too. Nobody wonders why rows are missing after closing the panel.
Step by step
- 01
Projects grid
All 24 projects in a grid view, with the view toolbar above.
The starting point: a populated table with status, owner, progress, duration and dates. The footer shows the row count and averages that the filter will change.
- 02
Open the filter
The empty filter panel: describe what you want to see, or add a condition.
Two ways in. Plain words ("longer than 60 days") suit people who do not know the field names; Add condition suits people who do. The empty state says plainly that nothing filters yet.
- 03
First condition
The description became "Where Duration > 60" and the grid already shows only the long projects.
The condition is editable like any other row, so a wrong guess from the description costs one click. The toolbar button switches to "Filtered by Duration" and the Duration column is tinted.
- 04
Add a second condition
A second row joined with "and": Progress ≥ 50 narrows the list to the projects that are both long and well along.
New rows start as "Project name contains …" with an empty value, so they change nothing until finished. The joiner on the second row switches between and/or for the whole list.
- 05
Filtered grid
The panel is closed: 8 projects, "Filtered by Duration, Progress" in the toolbar and both columns tinted.
Closing the panel keeps the filter. The button label, the tinted columns and the footer count say what is hidden and why; reopening the panel shows the same rows to edit or remove.
Built with shadcn/ui and Radix UI
- Button
- Popover
- Select
- Input
- Input Group
- Field
- Avatar
This is an original rebuild of the flow's structure, with its own brand, copy and artwork. Airtable is a trademark of its owner; this page is not affiliated with or endorsed by Airtable.
Frequently asked questions
Installing, adapting and theming this flow for Radix UI.
With a Pro plan, run npx shadcn@latest add @shadcnpro/flow-airtable-adding-a-filter. The shadcn CLI copies the flow into components/flows/airtable-adding-a-filter/ and adds the shadcn/ui components it uses. Base UI (@shadcnpro/base/flow-airtable-adding-a-filter) and React Aria (@shadcnpro/aria/flow-airtable-adding-a-filter) ship the same flow, with the same steps and copy.
No. It is an original rebuild of the structure of Airtable's filtering & sorting flow, written from scratch with shadcn/ui, with its own brand, copy and artwork. Airtable is a trademark of its owner, and this page is not affiliated with or endorsed by Airtable.
Yes, the flow is a pattern, not a fixed template. A step you add should follow the same rules as the others, listed under Step anatomy in the flow spec, so it reads as part of the same flow.
Use the prompt in the Installation section. The agent installs the flow, then reads the flow spec at https://pro.shadcn.co/flows/airtable-adding-a-filter.md, which describes the layout, the rules every step follows, each step's fields and actions, and how to adapt the flow. That way it builds a version with your brand and your steps instead of a one-to-one copy.
Yes, within the page. The 24 projects live in memory and every condition really filters them, including and/or, empty checks and the counts. The "Describe what you want to see" box uses a small keyword parser instead of a model. In a real app, run the same conditions in your query (or send them to your API), and swap the parser for an LLM call that returns condition objects.
Button, Popover, Select, Input, Input Group, Field and Avatar, in their Radix UI versions. Everything else is plain markup with Tailwind CSS.
Yes. The flow only uses semantic tokens such as bg-background, bg-card and text-muted-foreground, so it picks up your colours, radius and fonts and switches with dark mode. Use the theme menu above the preview to see it in the Pro themes.
Yes. Below the medium breakpoint the sketched icon rail and most toolbar buttons are hidden and the grid scrolls sideways with the name column pinned. In the filter panel each condition stacks its field, operator and value vertically next to the joiner, with the delete button beside them.