Data Components

Display financial data with data components.

TransactionTable

A comprehensive table component for displaying and managing financial transactions with advanced filtering, sorting, and categorization capabilities.

TypeScript
1import { TransactionTable } from "@openledger/accounting-react";
2
3function TransactionList() {
4return (
5
6<TransactionTable />
7); }

AreaChart

A responsive area chart component for visualizing financial data trends over time, perfect for cash balances and cumulative metrics.

TypeScript
1import { AreaChart } from "@openledger/accounting-react";
2
3function CashBalanceChart() {
4return (
5
6<AreaChart
7 onBalanceChange={(balance) => console.log("Current balance:", balance)}
8/>
9); }
PropTypeDescription
onStatsChange(stats: { revenue: number; expenses: number; profit: number; revenueChange: number; expensesChange: number; profitChange: number }) => voidCallback with financial statistics
heightnumberChart height (optional)
widthnumberChart width (optional)

BarChart

A bar chart component for comparing financial metrics across categories or time periods, ideal for profit and loss visualization.

TypeScript
1import { BarChart } from "@openledger/accounting-react";
2
3function ProfitLossChart() {
4return (
5
6<BarChart
7 onStatsChange={(stats) => {
8 console.log("Revenue:", stats.revenue);
9 console.log("Expenses:", stats.expenses);
10 console.log("Profit:", stats.profit);
11 }}
12/>
13); }
PropTypeDescription
onStatsChange(stats: { revenue: number; expenses: number; profit: number; revenueChange: number; expensesChange: number; profitChange: number }) => voidCallback with financial statistics
heightnumberChart height (optional)
widthnumberChart width (optional)

StatCard

Component for displaying financial metrics with trend indicators and comparison data.

TypeScript
1import { StatCard } from "@openledger/accounting-react";
2
3function RevenueMetric() {
4return (
5
6<StatCard
7 title="Revenue"
8 value="$50,000"
9 change={12.5}
10 changeText="vs last month"
11 compact={false}
12/>
13); }
PropTypeDescription
titlestringCard title
valuestringMain metric value
changenumberPercentage change
changeTextstringComparison text
compactbooleanDisplay in compact mode

TaskList

Component that displays actionable financial tasks, prioritized by importance and deadline.

TypeScript
1import { TaskList } from "@openledger/accounting-react";
2
3function AccountingTasks() {
4return <TaskList />;
5}

The TaskList intelligently suggests tasks based on:

  • Uncategorized transactions
  • Accounts that need reconciliation
  • Upcoming tax deadlines
  • Financial reports that need review

TransactionAssistant

AI-powered assistant for categorizing and managing transactions with natural language capabilities.

TypeScript
1import { TransactionAssistant } from "@openledger/accounting-react";
2import { useTransactions } from "@openledger/accounting-react";
3
4function TransactionManager() {
5const { transactions, loadingStatus, mutate } = useTransactions();
6
7return (
8
9<TransactionAssistant
10 transactions={transactions || []}
11 mutate={mutate}
12 loadingStatus={loadingStatus as "loading" | "error" | "success"}
13/>
14); }
PropTypeDescription
transactionsTransaction[]Array of transaction objects
mutate() => voidFunction to refresh transactions
loadingStatus”loading” | “error” | “success”Current loading state