Skip to Content
@get-asset/reactComponents

Classification Rules

Styled drop-in component. List active and archived business classification rules, read their conditions and actions, and archive, restore or undo an archive. Add and Edit hand off to your own editor.

Preview

Loading preview…

Required scopes

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

  • classification_rule:read
  • classification_rule:update
  • external_account:read
  • ledger:read

API reference

Root props

PropTypeDefaultDescription
state"loading" | "error" | "empty"—Force a state and skip API reads.
rulesTxnClassificationRulePublic[]—Override rules and skip API reads; archive and restore operate locally.
missingLedgerIdsstring[]—Additional ledger ids treated as missing. Applies to overridden and fetched rules.
view"active" | "archived"—Current view. Pair with onViewChange to control it.
defaultView"active" | "archived"—Initial uncontrolled view; defaults to active.
onViewChange(view: ClassificationRulesView) => void—Called when the selected view changes.
onAddRule() => void—Open the host editor in create mode.
onEditRule(ruleId: string) => void—Open the host editor for the selected rule.
pageSizenumber—Rules per API request; defaults to 25.
hasMoreboolean—Override pagination availability when rules is provided.
hasRulesboolean—Override whether either view has rules when rules is provided; controls view tabs.
formatAmount(value: number) => string—Money formatting in rule sentences. Defaults to US dollars.
formatDate(value: string) => string—ISO date formatting. SDK defaults to Jan 31, 2026; React defaults to Jan 31.
classNamestring—Additional class on the component shell. Uses the existing Asset theme tokens.

Behaviour

The host owns navigation between the list and the editor. Archive and restore writes update the list; cursor pagination retains loaded rules on a page failure.

On this page