Chart of Accounts
Styled, drop-in chart of accounts — sort code, name, a type tag and subtype, one row per ledger with children indented under their parent. The header carries a type filter and an “Add ledger” button that reveals the new-ledger form above the table, like Add account. Clicking a row opens its details in place as plain text, in the edit form's grid, with Edit where the form has Save; Edit swaps the text for the form's inputs. Each row's menu edits the ledger, adds a child or deletes it, and the row opens in place for that too: the edit form, the new child's form or a one-line delete confirm. A system ledger (one the API sends with is_deletable: false) can only be renamed: its edit form locks every other field, and Delete stays in the menu, disabled, with the tooltip “System ledgers cannot be deleted”. It manages the chart only: no report or ledger table renders inside it. Pass onViewAccount and each row also offers View report, which hands you the ledger to route wherever you show it. Hovering a name shows the ledger's description. Covers loading, error, empty and success, and keeps just the sort code and name on a narrow card.
Built on the headless ChartOfAccounts compound from @get-asset/sdk.
Preview
Loading preview…
Required scopes
The access token used by AssetProvider must include these scopes for this primitive to fetch data successfully:
ledger:readledger:createledger:updateledger:delete
API reference
Root props
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | "Chart of accounts" | The card's heading — a household might call the list "Categories". |
noun | string | "ledger" | What a ledger is called in the copy — "Add category", "New child category" for a household. |
showTaxCategory | boolean | false | Adds a Tax category column, and the tax category field to the ledger form, for businesses that file from the chart. |
hideCreate | boolean | false | Hides Add ledger. Add child stays in the row menu while the token allows it. |
onViewAccount | (target: LedgerViewTarget) => void | — | Optional. Adds View report to each row's menu and calls this with the ledger's { ledgerId, type, subtype } — route it to your ledger statement report, or the Transactions component filtered by type and subtype. Without it there is no View report. |
rowActions | ChartOfAccountsRowAction[] | — | The host's own row-menu items ({ label, onSelect(ledger), hidden?(ledger) }), listed before Delete — e.g. moving a ledger's line entries. |
onCreated / onUpdated / onDeleted | callbacks | — | Called after each write succeeds — with the ledger written, or the deleted ledger's id — for a host's own toast. |
defaultTypeFilter | LedgerType | "all" | "all" | Which type the filter starts on. |
defaultEditingId | string | — | Open this ledger's edit form in its row once the chart has loaded. |
defaultCreating | boolean | false | Open the new-ledger panel on mount. |
ledgers / state | overrides | — | Offline data and forced states for previews and tests — see the SDK page. |
className | string | — | Forwarded to the outer Card wrapper element. |
States
Loading preview…
Loading preview…
Loading preview…
Loading preview…
Loading preview…
Loading preview…