Cal.comdesign-system

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.

Example

Composition matches a real product call site. Copy is paraphrased.

apps/web · data table filter add menu

Call sites

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.

Source

packages/coss-ui/src/shared/filter-add-menu.tsx