dolfindevelopers

Invoices filters

ComponentReceivablesSDK + UI

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

Choose your integration

Ready to connect to Dolfin. Loads data through SDK hooks, with appearance and behaviour you can customise. Requires DolfinProvider.

Loading preview…

Installation

Needs the Dolfin registry token. The CLI copies the source into your app.

Terminal
bunx --bun shadcn@4.23.0 add @dolfin/ar-invoices-filters

Also installs: badge, button, command, input, popover, tabs, base-theme, base-states, ui-ar-invoices-filters.

Usage

screen.tsx
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

PropTypeDescription
filters requiredInvoiceListFiltersThe filters as typed (`useInvoiceFilters().filters`, or your own state).
onFiltersChange(filters: InvoiceListFilters) => voidCalled with the whole new filter set (`useInvoiceFilters().replace`); the list hook debounces the search.
hidereadonly ArInvoicesFilterControl[]Controls to leave out, e.g. `["customer"]` on a customer's own page.
showStatesbooleanAdds 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.
customersreadonly InvoiceCustomerOption[]Your own customers for the customer picker (searched in memory): it then makes no request.
childrenstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Extra controls at the end of the filter row.
classNamestring

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.

useInvoiceCustomerOptionsuseMessages

Files

Written to your app by the install command:

  • components/dolfin/ar/invoices-filters.tsx 88 lines
  • components/dolfin/ar/invoice-pickers.tsx 137 lines