Skip to Content

Filter Modal

FilterModal opens a dedicated modal for applying complex filters to the listing. Useful when there are too many filter fields to show inline.


Import

import { FilterModal } from "@phpcreation/frontend-crud-react-nextjs-bundle/components/FilterModal";

Usage

import { FilterModal } from "..."; <FilterModal open={filterOpen} onOpenChange={setFilterOpen} filterFields={entityFilterFields} initialValues={currentFilters} onApply={(filters) => { setFilters(filters); setFilterOpen(false); }} onReset={() => { clearFilters(); setFilterOpen(false); }} />

Props

PropTypeDescription
openbooleanModal open state
onOpenChange(open: boolean) => voidOpen state handler
filterFieldsFieldConfig[]Filter field definitions
initialValuesRecord<string, unknown>Pre-populated filter values
onApply(filters: Record<string, unknown>) => voidApply callback
onReset() => voidReset/clear callback

FilterModal uses RenderFilterFields internally — all filter field types (range, date, select) work the same as the inline filter panel.


Last updated on