@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.
Built on the headless ClassificationRules 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:
classification_rule:readclassification_rule:updateexternal_account:readledger:read
API reference
Root props
| Prop | Type | Default | Description |
|---|---|---|---|
state | "loading" | "error" | "empty" | — | Force a state and skip API reads. |
rules | TxnClassificationRulePublic[] | — | Override rules and skip API reads; archive and restore operate locally. |
missingLedgerIds | string[] | — | 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. |
pageSize | number | — | Rules per API request; defaults to 25. |
hasMore | boolean | — | Override pagination availability when rules is provided. |
hasRules | boolean | — | 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. |
className | string | — | 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.