Edit tax rate dialog
Edit a custom tax rate's code, name and rate in a dialog. Platform defaults open read-only. Shows the API's errors beside their fields and refreshes everything in receivables that works tax out from the rate.
Dialog: a modal you open from your own screen. You control when it opens with its 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-edit-tax-rate-dialogAlso installs: button, dialog, base-theme, ar-tax-rate-form, ui-ar-edit-tax-rate-dialog.
Usage
import { ArEditTaxRateDialog } from "@/components/dolfin/ar/edit-tax-rate-dialog";
// Place it anywhere inside your <DolfinProvider>.
<ArEditTaxRateDialog taxRate={taxRate} open={open} onOpenChange={handleOpenChange} />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 |
|---|---|---|
taxRate required | { id?: string; organisationId?: null | string; code: string; name: string; rate?: number | string; source: string; isReadOnly?: boolean; cre… | The rate to edit; the form reloads whenever it changes. Platform defaults open read-only. |
open required | boolean | |
onOpenChange required | (open: boolean) => void | |
onUpdated | (taxRate: TaxRate) => void | After the rate was saved; the dialog has closed. |
onSubmit | (body: UpdateTaxRateRequest) => Promise<TaxRate | void> | void | Saves it yourself instead of the SDK. The dialog closes once it resolves and shows the error in place if it rejects. |
submitting | boolean | Your own save is running. |
submitDisabledReason | string | Why the rate can't be saved (a platform default, or the role); disables Save. |
children | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | |
title | 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 dialog uses. Use them directly from @dolfinai/react to build your own version.
useMessagesuseTaxRateMutationsFiles
Written to your app by the install command:
components/dolfin/ar/edit-tax-rate-dialog.tsx128 lines