Invoices filters
Status tabs (all, drafts, outstanding, overdue, settled, void) and a state multi-select that always agree, a customer picker searched on the server, a search on invoice number or customer, and the issue date range. Controlled: filters and onFiltersChange (for example useInvoiceFilters().filters and .replace).
Component: A piece you place inside your own screens: a table, a form, a card or a dialog. You decide the layout around it. Pages vs components
Ready to connect to Dolfin. Loads data through SDK hooks, with appearance and behaviour you can customise. Requires DolfinProvider.
Installation
Needs the Dolfin registry token. The CLI copies the source into your app.
bunx --bun shadcn@4.23.0 add @dolfin/ar-invoices-filtersAlso installs: badge, button, command, input, popover, tabs, base-theme, base-states, ui-ar-invoices-filters.
Usage
import { ArInvoicesFilters } from "@/components/dolfin/ar/invoices-filters";
// Place it anywhere inside your <DolfinProvider>.
<ArInvoicesFilters filters={filters} />Renders inside DolfinProvider (set it up once). By default it loads its own data through the SDK. Supplied-data examples show how to override that behavior.
API reference
| Prop | Type | Description |
|---|---|---|
filters required | InvoiceListFilters | The filters as typed (`useInvoiceFilters().filters`, or your own state). |
onFiltersChange | (filters: InvoiceListFilters) => void | Called with the whole new filter set (`useInvoiceFilters().replace`); the list hook debounces the search. |
hide | readonly ArInvoicesFilterControl[] | Controls to leave out, e.g. `["customer"]` on a customer's own page. |
showStates | boolean | Adds the state multi-select beside the status tabs, for picking states the tabs don't group (Paid and Void together, say). Off by default: the tabs already set the state filter. `hide` still wins. |
customers | readonly InvoiceCustomerOption[] | Your own customers for the customer picker (searched in memory): it then makes no request. |
children | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Extra controls at the end of the filter row. |
className | string |
Customisation
Without editing the source, you can change:
- Class names
className- Messages
ar.filtersar.invoice.statesar.invoicesar.tabsbase.statescore.errors
Or edit the installed file directly: it is your code. See theming for colours and fonts.
Hooks
The SDK hooks this component uses. Use them directly from @dolfinai/react to build your own version.
useInvoiceCustomerOptionsuseMessagesFiles
Written to your app by the install command:
components/dolfin/ar/invoices-filters.tsx88 linescomponents/dolfin/ar/invoice-pickers.tsx137 lines