Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Blocks
  2. Filters
  3. API and Development

Filters

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Filters from @prepared911/ui/blocks/filters is the search and applied-filter bar. One FiltersValue holds search, an optional segment, and appliedFilters. The block does not filter rows. The page reads the value and narrows its own data. useFilterState stores that value for a caller that is not already holding it.
useFilterState
ReturnMeaning
value{ search, segment?, appliedFilters }.
searchvalue.search.
appliedFiltersvalue.appliedFilters.
onValueChangePass to Filters. Stores the next value unless the details are canceled.
clearFiltersClears search and applied filters. The segment stays.
isControlledTrue when value was passed on the first render.
Column visibility and column order are not part of this value. useFilteredData is not an export. Match rows in the page. Filters takes menuContentProps as data-* attributes only. They are stamped on the Filters menu, each quick filter menu, and a range panel, which is how a host marks those surfaces as part of the annotation layer. A submenu lives inside the Filters menu. A menu rendered in trailing is marked by the caller. Sorting a table is DataTable's enableSorting and onSortingChange, not a filter hook.
Previous
Filters / Usage
Next
Filters / Accessibility
On this page
useFilterState