Skip to Content
@get-asset/reactComponents

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.

Preview

Loading preview…

Required scopes

The access token used by AssetProvider must include these scopes for this primitive to fetch data successfully:

  • ledger:read
  • ledger:create
  • ledger:update
  • ledger:delete

API reference

Root props

PropTypeDefaultDescription
titlestring"Chart of accounts"The card's heading — a household might call the list "Categories".
nounstring"ledger"What a ledger is called in the copy — "Add category", "New child category" for a household.
showTaxCategorybooleanfalseAdds a Tax category column, and the tax category field to the ledger form, for businesses that file from the chart.
hideCreatebooleanfalseHides 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.
rowActionsChartOfAccountsRowAction[]—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 / onDeletedcallbacks—Called after each write succeeds — with the ledger written, or the deleted ledger's id — for a host's own toast.
defaultTypeFilterLedgerType | "all""all"Which type the filter starts on.
defaultEditingIdstring—Open this ledger's edit form in its row once the chart has loaded.
defaultCreatingbooleanfalseOpen the new-ledger panel on mount.
ledgers / stateoverrides—Offline data and forced states for previews and tests — see the SDK page.
classNamestring—Forwarded to the outer Card wrapper element.

States

Loading

Loading preview…

Success

Loading preview…

EmptyNo ledgers yet.

Loading preview…

Error

Loading preview…

CreatingThe new-ledger form, revealed above the table.

Loading preview…

EditingA ledger's edit form, open in its own row.

Loading preview…

On this page