Components
dashboard-export
KPIs as key/value blocks followed by one or two tables — the "Export to Excel" a SaaS needs.
KPIs rendered as key/value pairs, followed by one or two supporting tables. The "Export to Excel" feature a typical SaaS dashboard needs.
import { dashboardExport } from "@liasse/components";
import { render } from "@liasse/core";
import "@liasse/xlsx";
const doc = dashboardExport({
title: "Dashboard — September 2026",
kpis: [
{ label: "MRR", value: 622350, format: "currency" },
{ label: "Active accounts", value: 1284, format: "number" },
{ label: "Retention", value: 0.943, format: "percent" },
],
tables: [
{
title: "Revenue by line",
columns: [
{ key: "item", header: "Item" },
{ key: "ca", header: "Revenue", format: "currency", align: "right" },
{ key: "delta", header: "Δ", format: "percent", align: "right" },
],
rows: [
{ item: "Subscriptions", ca: 472900, delta: 0.131 },
{ item: "Licenses", ca: 61300, delta: 0.163 },
],
totals: ["ca"],
deltaColumn: "delta",
},
],
});
const bytes = await render(doc, { format: "xlsx" });Input
| Field | Type | Description |
|---|---|---|
title | string | Document + sheet title. |
kpis | DashboardKpi[] | { label, value, format? }. |
tables? | DashboardTable[] | One or two tables with optional totals. |