Tax rates list page
The tax rates page: header with how many country defaults and custom rates there are and a New rate action, source tabs and search, the tax rates table, and the create, edit and delete dialogs, with props for header actions, the empty state, an aside and extra form fields.
Page: A complete screen for one route, such as a bill or the invoices list. Mount it on a route in your app; connected SDK pages provide data and actions; standalone UI pages receive them as props. 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-tax-rates-list-pageAlso installs: button, base-theme, base-page, base-info-hint, ar-tax-rates-table, ar-create-tax-rate-dialog, ar-edit-tax-rate-dialog, ar-tax-rate-delete-dialog, ui-ar-tax-rates-list-page.
Usage
import { ArTaxRatesListPage } from "@/components/dolfin/ar/tax-rates-list-page";
// A whole screen: mount it on a route, inside your <DolfinProvider>.
export default function Route() {
return <ArTaxRatesListPage />;
}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 | TaxRateFilters | Initial tab and search. |
onFiltersChange | (filters: TaxRateFilters) => void | |
onCreated | (taxRate: TaxRate) => void | After a rate was created from the page. |
readOnly | boolean | Hide New rate and the row Edit and Delete actions. |
columns | TaxRateColumn[] | ((defaults: TaxRateColumn[]) => TaxRateColumn[]) | |
columnOrder | readonly string[] | |
columnVisibility | Readonly<Partial<Record<string, boolean>>> | |
rowActions | TaxRateRowAction[] | ((defaults: TaxRateRowAction[]) => TaxRateRowAction[]) | |
headerActions | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Rendered before the New rate button (e.g. a link to the accounting tax mappings). |
emptyState | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Replaces the empty state shown when the organisation has no rates. |
aside | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Rendered beside the list on wide pages. |
formFields | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Extra fields in the create and edit dialogs. |
title | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | |
eyebrow | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | |
description | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | |
className | string |
Customisation
Without editing the source, you can change:
- Class names
className- Messages
ar.taxRates
Or edit the installed file directly: it is your code. See theming for colours and fonts.
Hooks
The SDK hooks this page uses. Use them directly from @dolfinai/react to build your own version.
useCanManageTaxRatesuseMessagesuseTaxRatesFiles
Written to your app by the install command:
components/dolfin/ar/tax-rates-list-page.tsx193 lines