dolfindevelopers

Card transactions filters

ComponentExpensesSDK + UI

The card transaction feed's filters: merchant search (debounced by the list hook) and an occurred date range with a clear button, as plain controlled props (search, from, to, onSearchChange, onDatesChange); extra controls go in children.

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

Works with Dolfin’s SDK context, 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/expenses-card-transactions-filters

Also installs: button, input, base-theme, ui-expenses-card-transactions-filters.

Usage

screen.tsx
import { CardTransactionsFilters } from "@/components/dolfin/expenses/card-transactions-filters";

// Place it anywhere inside your <DolfinProvider>.
<CardTransactionsFilters filters={filters} />

Renders inside DolfinProvider (set it up once). It renders the data you pass as props.

API reference

PropTypeDescription
filters requiredCardTransactionListFiltersThe filters as typed (`useCardTransactions().filters`, or your own state). The row edits the merchant search and the occurred dates (`yyyy-MM-dd`, first and last day) and keeps every other filter as it is.
onFiltersChange(filters: CardTransactionListFilters) => voidCalled with the whole new filter set on every change (`useCardTransactions().replace`, which waits 400ms before sending the search).
hidereadonly CardTransactionsFilterControl[]Controls to leave out.
childrenstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…Extra controls at the end of the row.
classNamestring

Customisation

Without editing the source, you can change:

Class names
className
Messages
expenses.cardTransactions.filters

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.

useMessages

Files

Written to your app by the install command:

  • components/dolfin/expenses/card-transactions-filters.tsx 43 lines