dolfindevelopers

Tax rate form

ComponentReceivablesSDK + UI

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

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/ar-tax-rate-form

Also installs: input, label, base-theme, ui-ar-tax-rate-form.

Usage

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

PropTypeDescription
values requiredTaxRateFormValue
onChange required(next: TaxRateFormValue) => void
errorsReadonly<Record<string, string | undefined>>Messages by field: `code`, `name`, `rate`.
idPrefixstringPrefix for input ids (`tax-rate` gives `tax-rate-code`); keep it unique per page.
autoFocusboolean
disabledboolean
placeholdersbooleanShow the placeholders (the create form does, the edit form does not).
childrenstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…
classNamestring

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.

useMessages

Files

Written to your app by the install command:

  • components/dolfin/ar/tax-rate-form.tsx 128 lines