Bill lines
A bill's lines: quantity times unit price, tax, spend category with how it was classified (confirmed, AI or suggested), tags and the line net.
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
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/ap-bill-linesAlso installs: badge, base-money, base-status-badge, ui-ap-bill-lines.
Usage
import { BillLines } from "@/components/dolfin/ap/bill-lines";
// Place it anywhere inside your <DolfinProvider>.
<BillLines bill={bill} />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 |
|---|---|---|
bill required | { id?: string; organisationId?: string; state?: components["schemas"]["BillState"]; source?: components["schemas"]["BillSource"]; eInvoiceId… | |
categoryNames | Readonly<Record<string, string>> | Spend category names by key, for the category column. Given, nothing is fetched; otherwise the names are read from the organisation's categories. |
renderLineMeta | (line: BillLineItem) => ReactNode | Extra content under a line (for example where it posts in your accounting system). |
notice | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | A note above the lines. |
emptyState | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | Replaces the default note when the bill has no lines. |
className | string |
Customisation
Without editing the source, you can change:
- Class names
className- Messages
ap.bill.lines
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.
useBillCategoriesuseMessagesFiles
Written to your app by the install command:
components/dolfin/ap/bill-lines.tsx96 lines