Filter Add Menu
Menu to add/remove filter fields on a data table.
Menu to add/remove filter fields on a data table. When exactly one field is addable, the trigger skips the picker and opens that filter's editor. If a table only has one enabled field and it is already active, the toolbar Filter button reopens its editor. The active-row + hides when every remaining field is already active or disabled.
import { FilterAddMenu } from "@coss/ui/shared/filter-add-menu";Example
Composition matches a real product call site. Copy is paraphrased.
Call sites
| File | Notes |
|---|---|
apps/web/modules/data-table/components/filter-add-menu.tsx | Data table filters; optional Linear-style AI filter on bookings |
Optional AI props keep the default combobox path unchanged for tables that do not opt in. In AI-enabled tables, the idle AI option appears above filter fields; searching moves it below matching fields with the query appended. Activating an empty AI option opens AI mode, which shows history when available or an AI filter row when empty. Typing replaces history with the query row, while activating a typed option runs it immediately in the same click or Enter press. A failed query remains visible but cannot be submitted again until it is edited.
Example URLs
Not exhaustive — a few places you can open locally (e.g. http://localhost:3000) to see this in product.
| Path | Notes |
|---|---|
/members | Add filter menu (org required) |
/bookings/upcoming | Add filter on bookings |
Source
On This Page