Skip to content
WunderUI

Filter Menu

Pro

A filter for lists and tables: a button that opens a checklist of options with counts and a way to clear it, and a panel with search, Apply and data states for longer cases.

Playground

Installation

Filter Menu comes with WunderUI Core and Pro, in the package from your plan. See the plans.

Then import what you need:

tsx
import {
  FilterMenu,
  FilterAppliedBar,
  FilterMenuFooter,
  FilterMenuFooterProps,
  FilterMenuOption,
  FilterMenuPanel,
  FilterMenuPanelProps,
  FilterMenuProps,
  FilterMenuRow,
  FilterMenuRowProps,
  FilterMenuTrigger,
  FilterMenuTriggerProps,
  FilterPopover,
} from "@wunderui/react"

Then use it:

tsx
import { useState } from "react"
import { FilterMenu } from "@wunderui/react"

const options = [
  { value: "paid", label: "Paid", count: 8 },
  { value: "pending", label: "Pending", count: 4 },
  { value: "overdue", label: "Overdue", count: 2 },
]

export function StatusFilter() {
  // Every option checked means no filter.
  const [value, setValue] = useState(options.map((option) => option.value))

  return <FilterMenu label="Status" options={options} value={value} onValueChange={setValue} />
}

Expected result: You see a button reading Status. Press it and a menu of three checked rows opens with counts, an All row above and Clear filter below; uncheck Overdue and the button reads Status · 2.

When to use

Use Filter Menu for

  • A multi-select filter for a list or a table, with counts and a way back to everything
  • A longer or remote list that needs search, groups, a single choice or an Apply step
  • The applied filters as chips between the controls and the list

Use something else for

  • Data Table for filters generated from the columns, with operators, chips and server-side data
  • Dropdown Menu for a menu of actions, where an entry does something and the menu closes
  • Combobox for choosing a value for a form field from a searchable list

Trigger

The trigger is a plain button with the filter icon. While a filter is active it reads Status · 2 in the link colour, or shows a count pill.

Trigger

Size

Options

FilterMenu opens a menu of checkbox rows. The first row checks or clears every option and the last, Clear filter, resets, and every option checked means no filter.

Panel

FilterPopover opens a form in a popover: a title with Clear, an optional search field, checkbox or radio rows and a footer. Use it for search, groups, a single choice or an Apply step.

Data states

Options often come from a request. The panel shows loading, empty, error and no match states in place of the rows, and keeps the selection through all of them.

Applied bar

FilterAppliedBar shows what is applied as removable chips, with Clear all and an optional result count. It is the one place that says which filters are on, so put it between the controls and the list.

Keyboard interactions

FilterMenu is a menu: one tab stop, then the arrow keys. FilterPopover is a form: every control is a tab stop and the arrow keys do not move between rows.

EnterorSpaceorArrowDown
On the trigger: opens the menu and moves focus into it. In a FilterPopover, Enter and Space open it and focus lands on the first row.
ArrowDownorArrowUp
In the menu: moves to the next or previous row, the All row and Clear filter included.
HomeorEnd
In the menu: first or last row. End lands on Clear filter.
SpaceorEnter
On a row: checks or clears it. The menu stays open, so several can be set in a row. On Clear filter: checks every option again and closes the menu.
TaborShiftTab
In a FilterPopover: moves through Clear, the search field, the All row, each row and the footer buttons in order. There is one tab stop for every row.
Esc
Closes the menu or the popover and returns focus to the trigger.

Behavior and motion

How the filter models its value, what its trigger says, and what the panel does in each mode.

Value
The value is the list of checked option values. Every option checked means no filter, so the trigger is idle, and ticking a row returns the values in the order of the options.
All row
In FilterMenu the All row reads checked, mixed or empty and checks or clears every option. In the panel it acts on the rows you see, so with a search active it checks only the matches.
Nothing checked
Clearing every option is a filter that matches nothing. FilterMenu then reads Status · 0 and FilterPopover shows no count, while the page decides what to show, ideally a message with Clear all.
Trigger
An active filter turns the trigger link-coloured and adds the count, inline as · 2 or in a pill. Its name reads Status, 2 of 3 selected, and a trailing chevron turns while the popup is open.
Open and modal
FilterMenu opens a menu that stays open while you tick, and by default locks the page behind it. FilterPopover is not modal, and both can be controlled from outside.
Instant and Apply
Instant mode reports every tick. With Apply the ticks are a draft: Apply commits and closes, Cancel drops and closes, and Reset checks every option again.
Single choice
In single choice mode the rows are radios and the first option stands for no filter, such as Any status. Choosing it reads as unfiltered.
Search and groups
The search narrows rows by label or search text, keeps the selection and offers Clear search when nothing matches. Options in the same group sit under a group label, separated by a line.
Data states
A status swaps the rows for skeletons while loading, an empty message, or an error with Retry, and keeps the selection and header. Clear is disabled in all three, and Apply too while loading.
Applied bar
The bar lists what is applied as removable chips, plus Clear all. A maximum visible count hides the rest behind a +N chip, and the bar draws nothing while there are no filters.
Not included
The library has no operators, field choice or saved filters. The Figma page also designs a range filter, saved filters and a property row that stay in Figma.
Motion
The menu fades in and grows from the trigger, a step faster on close, and the chevron turns on the fast duration. With reduced motion the menu and chevron change without movement.

Anatomy

The figure shows a FilterMenu with two of three options checked. FilterPopover, the panel, the footer and the applied bar are separate parts and have no number.

  • data-slot="filter-menu"

    A multi-select filter: a trigger button and a menu of checkbox rows. The value lists the checked options, and every option checked means no filter.

  • data-slot="filter-menu-trigger"

    A plain button with the filter icon and the label. While a filter is active it reads Status · 2 in the link colour, or shows a count pill, and its name says Status, 2 of 3 selected.

  • data-slot="filter-menu-all"

    The first row. It checks or clears every option and reads checked, mixed or empty, depending on how many options are on.

  • data-slot="filter-menu-item"

    One option as a checkbox menu item, with an optional second line and a count on the right. Ticking it keeps the menu open, and a disabled option stays in the list but cannot be changed.

  • data-slot="filter-menu-box"Optional

    The visual checkbox at the start of a row, filled in the tint of the row when on. It is decorative, and the row carries the checked state.

  • Optional

    How many rows the option holds, in tabular figures on the right. Pass the count on the option.

  • data-slot="filter-menu-clear"

    Checks every option again and then calls your clear handler. It is disabled while no filter is active and closes the menu.

  • data-slot="filter-menu-trigger"Optional

    The trigger button as its own part. It shows a count inline (Status · 2) or as a pill, can have a chevron that turns when open, and FilterMenu and FilterPopover render it for you.

  • data-slot="filter-popover"Optional

    The trigger plus a filter form in a popover. Use it when the filter needs a search field, groups, a single choice, Apply and Cancel or a data state.

  • data-slot="filter-panel"Optional

    The filter form on its own: a title with Clear, a search field, the rows and a footer. It uses checkbox and radio semantics, so it can sit in a sidebar or a sheet as well as a popover.

  • data-slot="filter-panel-row"Optional

    One row of the panel: a checkbox or a radio, a label, an optional description and an optional count. A mixed checked state draws the select-all look.

  • data-slot="filter-panel-footer"Optional

    The status line with Reset, or in Apply mode Reset, Cancel and Apply.

  • data-slot="filter-applied-bar"Optional

    The applied filters as removable chips, an optional +N chip, Clear all and an optional result count. It draws nothing while there is no filter.

Best practices

  • Do

    Pass the real counts on the options. A count tells the person what a filter will show before they commit to it.

  • Do

    Treat every option checked as no filter, and show the applied bar only while something narrows the list. Put it between the controls and the list so filters and result read together.

  • Do

    Say what an empty result means and how to leave it: a line and Clear all, as in the example, not an empty table.

  • Do

    Use FilterPopover when the list is long, comes from a request or needs Apply, and give it a status so loading, empty and error each have a state instead of a blank panel.

  • Do

    Name the filter by what it filters, such as Status or Owner, not Filters, once a page has more than one.

  • Don’t

    Don't turn off the modal behaviour on a real page unless you want the page behind the menu to stay usable. By default it locks the page, as every menu does.

  • Don’t

    Don't expect operators or a choice of fields. A filter menu is one field with a list of values; for is, contains and between per column, use Data Table.

  • Don’t

    Don't use Apply for a short list that filters instantly. Use it when each change is expensive, such as a request, and say what is applied next to the button.

API reference

FilterMenu and its related parts are plain components, so these tables list every prop. FilterPopover takes every prop of FilterMenuPanel plus the trigger props.

A multi-select filter: a trigger button and a menu of checkbox rows. The value lists the checked options, and every option checked means no filter.

PropTypeDefaultDescription
labelstring"Filters"The text of the trigger. Default .
options requiredFilterMenuOption[]—The options: , , and optionally , and . and are read by the panel and ignored by FilterMenu.
value requiredstring[]—The checked option values. Every option checked means no filter. In single mode it holds the one chosen value.
onValueChange required(value) => void—Called with the next checked values, in the order of .
size"sm" | "md" | "lg""md", or , following the button scale. Default .
align"start" | "center" | "end""end"How the menu lines up with the trigger: , or . Default .
countStyle"inline" | "pill"— writes the count as after the label, draws it in a small pill. Default .
chevronboolean—Shows a trailing chevron that turns when the popup is open.
openboolean—Whether the popup is open. Pass it with to control it; without it the popup keeps its own state.
onOpenChange(open: boolean) => void—Called when the popup opens or closes.
allLabelstring"All"The text of the row that checks or clears every option. Default .
defaultOpenboolean—Starts the popup open when it is not controlled.
iconReactNode—The icon before the label. Default the lucide list-filter glyph.
modalboolean—Whether the page behind the menu is locked while it is open. Default ; leaves the page usable.
onClear() => void—Called after Clear filter has checked every option again, for example to go back to the first page.

The trigger button as its own part. It shows a count inline (Status · 2) or as a pill, can have a chevron that turns when open, and FilterMenu and FilterPopover render it for you.

PropTypeDefaultDescription
activebooleanfalseMarks the filter as active: the link colour and the count.
chevronbooleanfalseShows a trailing chevron that turns when the popup is open.
countnumber—The number of selected options. It shows only while .
countStyle"inline" | "pill""inline" writes the count as after the label, draws it in a small pill. Default .
focusableWhenDisabledbooleanfalseKeeps a disabled trigger in the tab order. It is a prop of the Button the trigger is built on.
iconReactNode—The icon before the label. Default the lucide list-filter glyph.
labelstring"Filters"The text of the trigger. Default .
nativeButtonbooleantrueWhether the element is a native button. A prop of the Button the trigger is built on.
openbooleanfalseDraws the open look: the pressed background and a turned chevron.
pendingboolean—Shows a spinner and ignores presses. A prop of the Button the trigger is built on.
phase"error" | "pending" | "success" | "idle"—, , or . A prop of the Button the trigger is built on.
shape"rounded" | "pill"— or . A prop of the Button the trigger is built on.
size"sm" | "md" | "lg""md", or , following the button scale. Default .

The trigger plus a filter form in a popover. Use it when the filter needs a search field, groups, a single choice, Apply and Cancel or a data state.

PropTypeDefaultDescription
titlestring—The heading of the panel. It names the group and, in a popover, is the default label of the trigger. The header with its Clear button shows only when you set it.
options requiredFilterMenuOption[]—The options: , , and optionally , and . and are read by the panel and ignored by FilterMenu.
value requiredstring[]—The checked option values. Every option checked means no filter. In single mode it holds the one chosen value.
onValueChange required(value) => void—Called with the next checked values, in the order of .
selection"multiple" | "single""multiple" shows checkboxes and an All row; shows radios and treats the first option as the unfiltered choice. Default .
searchableboolean—Shows a search field that narrows the rows by label or . The selection is kept while you search.
applyboolean—Holds the ticks as a draft until Apply is pressed. The footer then has Reset, Cancel and Apply.
status"ready" | "loading" | "empty" | "error"—, , or . Loading draws skeleton rows, empty and error draw a message in place of the rows. Default .
resultCountnumber—Shows a footer with . In Apply mode the footer is always there.
align"start" | "center" | "end""start"How the popover lines up with the trigger: , or . Default .
allLabelstring—The text of the row that checks or clears every option. Default .
allRowboolean—Shows the All row in multiple mode. Default .
applyLabelstring—The text of the Apply button. Default .
cancelLabelstring—The text of the Cancel button. Default .
chevronbooleantrueShows a trailing chevron that turns when the popover is open. Default .
clearLabelstring—The text of the header Clear button. Default .
contentClassNamestring—Extra classes for the popover.
countStyle"inline" | "pill""pill" or . Default .
defaultOpenboolean—Starts the popup open when it is not controlled.
emptyActionReactNode—A button or link for the empty state.
emptyDescriptionstring—The line under the empty title.
emptyTitlestring—The title of the empty state. Default .
errorDescriptionstring—The line under the error title. Default
errorTitlestring—The title of the error state. Default .
iconReactNode—The icon before the label. Default the lucide list-filter glyph.
labelstring—The text of the trigger. Default the , else .
noMatchDescriptionstring—The line under it. Default
noMatchTitlestring—The title shown while a search finds nothing. Default .
onApply(value) => void—Called with the applied values when Apply is pressed. In a popover it also closes.
onCancel() => void—Called when Cancel is pressed. The draft is dropped; in a popover it also closes.
onClear() => void—Called by Clear after the selection is reset to the unfiltered state.
onOpenChange(open) => void—Called when the popup opens or closes.
onReset() => void—Called by Reset after the selection is reset.
onRetry() => void—Called by Retry in the error state. Without it the error has no button.
onSearchChange(query) => void—Called with the next search text.
openboolean—Whether the popup is open. Pass it with to control it; without it the popup keeps its own state.
resetLabelstring—The text of the footer Reset button. Default .
resultLabel(count) => string—Builds the text of the result count: .
searchstring—The search text. Pass it with to control it.
searchPlaceholderstring—The placeholder and accessible name of the search field. Default .
size"sm" | "md" | "lg""md", or , following the button scale. Default .
statusTextstring—A fixed footer text that replaces the result count.
triggerClassNamestring—Extra classes for the trigger.

The filter form on its own: a title with Clear, a search field, the rows and a footer. It uses checkbox and radio semantics, so it can sit in a sidebar or a sheet as well as a popover.

PropTypeDefaultDescription
titlestring—The heading of the panel. It names the group and, in a popover, is the default label of the trigger. The header with its Clear button shows only when you set it.
options requiredFilterMenuOption[]—The options: , , and optionally , and . and are read by the panel and ignored by FilterMenu.
value requiredstring[]—The checked option values. Every option checked means no filter. In single mode it holds the one chosen value.
onValueChange required(value) => void—Called with the next checked values, in the order of .
selection"multiple" | "single""multiple" shows checkboxes and an All row; shows radios and treats the first option as the unfiltered choice. Default .
searchablebooleanfalseShows a search field that narrows the rows by label or . The selection is kept while you search.
applybooleanfalseHolds the ticks as a draft until Apply is pressed. The footer then has Reset, Cancel and Apply.
status"ready" | "loading" | "empty" | "error""ready", , or . Loading draws skeleton rows, empty and error draw a message in place of the rows. Default .
allLabelstring"All"The text of the row that checks or clears every option. Default .
allRowbooleantrueShows the All row in multiple mode. Default .
applyLabelstring"Apply"The text of the Apply button. Default .
cancelLabelstring"Cancel"The text of the Cancel button. Default .
clearLabelstring"Clear"The text of the header Clear button. Default .
emptyActionReactNode—A button or link for the empty state.
emptyDescriptionstring—The line under the empty title.
emptyTitlestring"No options available"The title of the empty state. Default .
errorDescriptionstring"Check your connection and try again."The line under the error title. Default
errorTitlestring"Couldn’t load options"The title of the error state. Default .
noMatchDescriptionstring"Try another term. Your selection is kept."The line under it. Default
noMatchTitlestring—The title shown while a search finds nothing. Default .
onApply(value) => void—Called with the applied values when Apply is pressed. In a popover it also closes.
onCancel() => void—Called when Cancel is pressed. The draft is dropped; in a popover it also closes.
onClear() => void—Called by Clear after the selection is reset to the unfiltered state.
onReset() => void—Called by Reset after the selection is reset.
onRetry() => void—Called by Retry in the error state. Without it the error has no button.
onSearchChange(query) => void—Called with the next search text.
resetLabelstring"Reset"The text of the footer Reset button. Default .
resultCountnumber—Shows a footer with . In Apply mode the footer is always there.
resultLabel(count) => string—Builds the text of the result count: .
searchstring—The search text. Pass it with to control it.
searchPlaceholderstring"Search…"The placeholder and accessible name of the search field. Default .
statusTextstring—A fixed footer text that replaces the result count.
surfacebooleantrueDraws the panel as a popover surface with a border and a shadow. FilterPopover turns it off because the popover supplies it. Default .

One row of the panel: a checkbox or a radio, a label, an optional description and an optional count. A mixed checked state draws the select-all look.

PropTypeDefaultDescription
label requiredReactNode—The text of the row.
checkedboolean | "mixed"false, or for the select-all state.
countnumber | string—A number or a text on the right. Numbers are formatted with thousands separators.
descriptionstring—A second line under the label.
emphasisbooleanfalseSets the label in medium weight, as the All row does.
kind"checkbox" | "radio""checkbox" or . Default .

The applied filters as removable chips, an optional +N chip, Clear all and an optional result count. It draws nothing while there is no filter.

PropTypeDefaultDescription
filters requiredAppliedFilter[]—The applied filters: each. A chip reads .
onRemove(id) => void—Called with the of the filter whose chip was removed.
onClearAll() => void—Called by Clear all. Without it the button is left out.
maxVisiblenumber—Shows this many chips and a +N chip for the rest; pressing +N shows them all.
resultCountnumber—Shows the number of results at the right, as a polite status.
clearAllLabelstring"Clear all"The text of Clear all. Default .
resultLabel(count) => string—Builds the text of the result count: .

Notes for AI

Give your coding assistant the Markdown reference instead of screenshots.

MCPget_component("filter-menu")
InstallIncluded in Core and Pro

The full library index for assistants is at /llms.txt.