Tax rate form
The tax rate fields shared by the create and edit dialogs: code, name and rate (0 to 100%), with client-side checks and the API's field errors beside their fields.
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
Works with Dolfin’s SDK context, 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-rate-formAlso installs: input, label, base-theme, ui-ar-tax-rate-form.
Usage
import { ArTaxRateFormFields } from "@/components/dolfin/ar/tax-rate-form";
// Place it anywhere inside your <DolfinProvider>.
<ArTaxRateFormFields values={values} onChange={handleChange} />Renders inside DolfinProvider (set it up once). It renders the data you pass as props.
API reference
| Prop | Type | Description |
|---|---|---|
values required | TaxRateFormValue | |
onChange required | (next: TaxRateFormValue) => void | |
errors | Readonly<Record<string, string | undefined>> | Messages by field: `code`, `name`, `rate`. |
idPrefix | string | Prefix for input ids (`tax-rate` gives `tax-rate-code`); keep it unique per page. |
autoFocus | boolean | |
disabled | boolean | |
placeholders | boolean | Show the placeholders (the create form does, the edit form does not). |
children | 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.formcore.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.
useMessagesFiles
Written to your app by the install command:
components/dolfin/ar/tax-rate-form.tsx128 lines