FilterPopover

Spec · from metadata

When to use

  • •Only in existing code awaiting migration to FilterBar — do not add new uses.

When not to use

  • •Any new filter UI, tables and dashboards alike — use `FilterBar` (toolbar row filters, push-down panel for the rest)
  • •Single-field search — just use an `Input` with type='search'
  • •Filters that need to update other parts of the page in real time as they change — caller wants a different UX shape; FilterPopover is explicitly batched-on-Apply

Anti-patterns

Avoid<FilterPopover
  triggerLabel="Filters"
  applyLabel="Save"
  clearLabel="Reset"
  onApply={...}
  onClear={...}
>
  ...
</FilterPopover>
Prefer<FilterPopover
  triggerLabel="Filters"
  onApply={...}
  onClear={...}
>
  ...
</FilterPopover>

Footer button labels are hard-coded — applyLabel and clearLabel props don't exist. The drift winner from §3 of the spec is enforced by the API. 'Reset' implies a saved default (wrong mental model); 'Save' implies persistence (wrong mental model — filters are session-scoped). Use 'Clear All' + 'Apply'.

Avoid<FilterPopover
  triggerLabel="Filters"
  onApply={...}
  onClear={...}
>
  <Input
    placeholder="Member ID"
    value={memberId}
    onChange={(e) => { setMemberId(e.target.value); applyFilter(); }}
  />
</FilterPopover>
Prefer<FilterPopover
  triggerLabel="Filters"
  onApply={() => applyFilter(draft)}
  onClear={() => setDraft({})}
>
  <Input
    placeholder="Member ID"
    value={draft.memberId}
    onChange={(e) => setDraft({ ...draft, memberId: e.target.value })}
  />
</FilterPopover>

Filters are batched — they apply when the user clicks Apply, not on every keystroke. Auto-apply causes UI thrash in popovers and conflicts with the established mental model. Caller manages draft state; the compound only commits on Apply.

Avoid// Analytics dashboard
<FilterPopover triggerLabel="Filter dashboard" ...>
  <DatePicker ... />
  <Select ... />
</FilterPopover>
Prefer// Analytics dashboard — FilterBar, filters in the row
<FilterBar ... />

FilterPopover is deprecated. Filters sit in the toolbar row or a push-down panel, never a popover, so the active filters stay visible next to the data they shape. Use FilterBar; see its "Migrating from FilterPopover" section.

Accessibility

  • Min touch target48px
  • Screen readerTrigger button has aria-expanded reflecting popover state (inherited from Popover primitive). Active-count Badge is read inline after the label (e.g. 'Filters, 2'). Footer buttons have explicit labels 'Clear All' and 'Apply'.
  • ContrastTrigger is outline Button variant; meets WCAG AA. Badge uses secondary variant on the outline button background.

Token bindings

TokenCategoryUsage
popovercolorPopover surface (from the Popover primitive)
popover-foregroundcolorPopover text color
bordercolorPopover border and the footer's top divider (border-border)
4 (16px) / 3 (12px)spacingBody padding / footer padding + field gaps
mdradiusPopover container rounding (inherited from Popover primitive)
Recent changes
  • new

    FilterBar: one filter row for tables and reports

    2026-10-30

  • new

    Compound components join the catalog

    2026-07-09

[!WARNING] Deprecated. FilterPopover is replaced by FilterBar: filters sit in the toolbar row or a push-down panel, never a popover. It still works and stays exported until 1.0. Do not add new uses; see the migration guide. The rest of this page documents code still in the wild.

Deprecated — use FilterBar. A trigger button that opens a popover containing caller-supplied form fields, with a Clear All / Apply footer the compound enforces. Still exported and working in existing Provider, Member and Campus code until it is removed in 1.0.

[!NOTE] Compound component — an opinionated composition of Helix primitives. Composes: Button, Popover, Badge.

Import

import { FilterPopover } from "@timelycare/helix-ui"

Usage

const [draft, setDraft] = useState({ memberId: "", visitId: "" })
const [applied, setApplied] = useState(draft)
const activeCount = Object.values(applied).filter(Boolean).length

<FilterPopover
  triggerLabel="Filters"
  activeCount={activeCount}
  onApply={() => setApplied(draft)}
  onClear={() => setDraft({ memberId: "", visitId: "" })}
>
  <Input
    placeholder="Member ID"
    value={draft.memberId}
    onChange={(e) => setDraft({ ...draft, memberId: e.target.value })}
  />
  <Input
    placeholder="Visit ID"
    value={draft.visitId}
    onChange={(e) => setDraft({ ...draft, visitId: e.target.value })}
  />
</FilterPopover>

TimelyCare Design System

v0.14.0