# Billing overview

A consumer-owned plan, usage allowance and semantic invoice overview with native actions and destinations.

Access: pro. Category: Blocks. Kind: composite.

## When to use

- Use it when a page needs a consumer-owned plan, usage allowance and semantic invoice overview with native actions and destinations.
- Choose it inside an authenticated product surface when the host application owns routing, persistence, and service calls.

## Alternatives

- Choose empty-state instead when empty collections, search results and errors with a clear next action is the actual interface need, rather than billing overview.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Billing overview

```sh
npx shadcn@latest add @tidal-pro/billing-overview
```

Stylesheets: `components/ui/tidal.css`, `components/ui/billing-overview.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/billing-overview.css";
import{TidalBillingOverview}from"./components/ui/billing-overview";
export default(p:Parameters<typeof TidalBillingOverview>[0])=><div className="tidal-scope"><TidalBillingOverview {...p}/></div>;
```

## Structured props

- `TidalBillingOverview.allowances: ReadonlyArray<TidalBillingAllowance>`: Required allowances value accepted by this exported component.
- `TidalBillingOverview.invoiceCaption: ReactNode`: Required invoice caption value accepted by this exported component.
- `TidalBillingOverview.invoices: ReadonlyArray<TidalBillingInvoice>`: Required invoices value accepted by this exported component.
- `TidalBillingOverview.plan: TidalBillingPlan`: Required plan value accepted by this exported component.
- `TidalBillingOverview.title: ReactNode`: Required title value accepted by this exported component.
- `TidalBillingOverview.allowancesLabel?: string | undefined` (default "Usage allowances"): Optional allowances label value accepted by this exported component.
- `TidalBillingOverview.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalBillingOverview.emptyAllowancesMessage?: ReactNode` (default "No usage allowances are available."): Optional empty allowances message value accepted by this exported component.
- `TidalBillingOverview.emptyInvoicesMessage?: ReactNode` (default "No invoices are available."): Optional empty invoices message value accepted by this exported component.
- `TidalBillingOverview.eyebrow?: ReactNode` (default "Billing overview"): Optional eyebrow value accepted by this exported component.
- `TidalBillingOverview.footer?: ReactNode`: Optional footer value accepted by this exported component.
- `TidalBillingOverview.headingLevel?: "h2" | "h3" | "h4" | undefined` (default "h2"): Optional heading level value accepted by this exported component.
- `TidalBillingOverview.invoiceCountLabel?: ((count: number) => string) | undefined` (default (count) => `${count} invoices`): Optional invoice count label value accepted by this exported component.
- `TidalBillingOverview.invoiceHeading?: ReactNode` (default "Invoices"): Optional invoice heading value accepted by this exported component.
- `TidalBillingOverview.invoiceLabels?: Partial<TidalBillingInvoiceLabels> | undefined`: Optional invoice labels value accepted by this exported component.
- `TidalBillingOverview.invoiceScrollProps?: Omit<HTMLAttributes<HTMLDivElement>, "aria-label" | "children"> | undefined`: Optional invoice scroll props value accepted by this exported component.
- `TidalBillingOverview.invoiceScrollRef?: Ref<HTMLDivElement> | undefined`: Optional invoice scroll ref value accepted by this exported component.
- `TidalBillingOverview.periodControl?: TidalBillingPeriodControl | undefined`: Optional period control value accepted by this exported component.
- `TidalBillingOverview.tableProps?: Omit<TableHTMLAttributes<HTMLTableElement>, "children"> | undefined`: Optional table props value accepted by this exported component.
- `TidalBillingOverview.tableRef?: Ref<HTMLTableElement> | undefined`: Optional table ref value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/billing-overview.tsx) | [Manifest](https://tidalui.com/examples/billing-overview.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
"use client";

import "./components/ui/tidal.css";

import { useId, useMemo, useState } from "react";

import { TidalBillingOverview, type TidalBillingAllowance, type TidalBillingInvoice } from "./components/ui/billing-overview";

import "./components/ui/billing-overview.css";



const tidalExampleStyles = ".tidal-scope .billing-overview-demo,\n.tidal-scope .billing-overview-demo * {\n  box-sizing: border-box;\n}\n\n.tidal-scope .billing-overview-demo {\n  width: 100%;\n  max-width: 1160px;\n  min-width: 0;\n  container: billing-overview-demo / inline-size;\n}\n\n.tidal-scope .billing-overview-demo-frame {\n  display: grid;\n  width: 100%;\n  min-width: 0;\n  gap: 13px;\n  padding: 20px;\n  border: 1px solid var(--t-border);\n  border-radius: 22px;\n  background: var(--t-subtle);\n  color: var(--t-ink);\n}\n\n.tidal-scope .billing-overview-demo-details {\n  display: grid;\n  grid-template-columns: repeat(2, minmax(0, 1fr));\n  gap: 10px;\n}\n\n.tidal-scope .billing-overview-demo-details article {\n  min-width: 0;\n  padding: 18px 20px;\n  border: 1px solid var(--t-border);\n  border-radius: 18px;\n  background: var(--t-surface);\n  scroll-margin-block: 18px;\n}\n\n.tidal-scope .billing-overview-demo-details article:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 3px;\n}\n\n.tidal-scope .billing-overview-demo-details article > span {\n  color: var(--t-muted);\n  font-size: 11px;\n  font-weight: 680;\n  letter-spacing: 0.09em;\n  line-height: 1.35;\n  text-transform: uppercase;\n}\n\n.tidal-scope .billing-overview-demo-details h3 {\n  margin: 7px 0 0;\n  font-size: 17px;\n  font-weight: 650;\n  letter-spacing: -0.035em;\n  line-height: 1.25;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .billing-overview-demo-details p {\n  margin: 7px 0 0;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.55;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .billing-overview-demo-details dl {\n  display: flex;\n  gap: 18px;\n  margin: 13px 0 0;\n}\n\n.tidal-scope .billing-overview-demo-details dl > div {\n  min-width: 0;\n}\n\n.tidal-scope .billing-overview-demo-details dt {\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.35;\n}\n\n.tidal-scope .billing-overview-demo-details dd {\n  margin: 3px 0 0;\n  font-size: 11px;\n  line-height: 1.4;\n  overflow-wrap: anywhere;\n}\n\n@container billing-overview-demo (max-width: 520px) {\n  .tidal-scope .billing-overview-demo-frame {\n    gap: 9px;\n    padding: 8px;\n  }\n\n  .tidal-scope .billing-overview-demo-details {\n    grid-template-columns: minmax(0, 1fr);\n  }\n\n  .tidal-scope .billing-overview-demo-details article {\n    padding: 16px;\n  }\n}";

const PERIOD_ALLOWANCES: Record<
  "current" | "previous",
  readonly TidalBillingAllowance[]
> = {
  current: [
    {
      id: "briefs",
      label: "Sample briefs",
      valueLabel: "18 of 30",
      used: 18,
      limit: 30,
      description: "Fictional allowance for the current preview period.",
    },
    {
      id: "exports",
      label: "Sample exports",
      valueLabel: "7 of 20",
      used: 7,
      limit: 20,
      description: "Local display data with no metered service attached.",
    },
    {
      id: "review-hours",
      label: "Review hours",
      valueLabel: "12 of 40",
      used: 12,
      limit: 40,
      description: "A fictional time allowance for layout review.",
    },
    {
      id: "archive-space",
      label: "Archive space",
      valueLabel: "4.2 of 10 GB",
      used: 4.2,
      limit: 10,
      description: "No file storage is measured by this preview.",
    },
  ],
  previous: [
    {
      id: "briefs",
      label: "Sample briefs",
      valueLabel: "24 of 30",
      used: 24,
      limit: 30,
      description: "Fictional allowance for the previous preview period.",
    },
    {
      id: "exports",
      label: "Sample exports",
      valueLabel: "15 of 20",
      used: 15,
      limit: 20,
      description: "Local display data with no metered service attached.",
    },
    {
      id: "review-hours",
      label: "Review hours",
      valueLabel: "31 of 40",
      used: 31,
      limit: 40,
      description: "A fictional time allowance for layout review.",
    },
    {
      id: "archive-space",
      label: "Archive space",
      valueLabel: "6.8 of 10 GB",
      used: 6.8,
      limit: 10,
      description: "No file storage is measured by this preview.",
    },
  ],
};

interface InvoiceSeed {
  id: string;
  label: string;
  accessibleLabel: string;
  date: string;
  total: string;
  status: string;
  note: string;
}

const INVOICES: readonly InvoiceSeed[] = [
  {
    id: "sample-1048",
    label: "Sample invoice 1048",
    accessibleLabel: "Sample invoice 1048",
    date: "October 1 sample",
    total: "$24.00 fictional",
    status: "Preview only",
    note: "A fictional monthly plan line with no payment transaction.",
  },
  {
    id: "sample-1036",
    label: "Sample invoice 1036",
    accessibleLabel: "Sample invoice 1036",
    date: "September 1 sample",
    total: "$24.00 fictional",
    status: "Preview only",
    note: "A local invoice preview supplied directly to the component.",
  },
  {
    id: "sample-1024",
    label: "Sample invoice 1024",
    accessibleLabel: "Sample invoice 1024",
    date: "August 1 sample",
    total: "$24.00 fictional",
    status: "Preview only",
    note: "No receipt, charge, account, or downloadable document exists.",
  },
];

export function BillingOverviewDemo() {
  const generatedId = useId().replace(/:/g, "");
  const planDetailId = `billing-${generatedId}-plan-detail`;
  const invoicePreviewId = `billing-${generatedId}-invoice-preview`;
  const [period, setPeriod] = useState<"current" | "previous">("current");
  const [planDetailsShown, setPlanDetailsShown] = useState(false);
  const [selectedInvoiceId, setSelectedInvoiceId] = useState<string | null>(
    null,
  );
  const [message, setMessage] = useState(
    "Current fictional usage period selected.",
  );

  const invoices = useMemo<readonly TidalBillingInvoice[]>(
    () =>
      INVOICES.map((invoice) => ({
        ...invoice,
        destination: {
          href: `#${invoicePreviewId}`,
          label: `Preview ${invoice.accessibleLabel} on this page`,
          linkProps: {
            onClick: () => {
              setSelectedInvoiceId(invoice.id);
              setMessage(`${invoice.label} opened in the local preview.`);
            },
          },
        },
      })),
    [invoicePreviewId],
  );

  const selectedInvoice = INVOICES.find(
    (invoice) => invoice.id === selectedInvoiceId,
  );

  return (
    <section
      className="billing-overview-demo"
      aria-label="Billing overview preview"
    >
      <div className="billing-overview-demo-frame">
        <TidalBillingOverview
          title="Studio plan"
          eyebrow={null}
          description="Track allowances and review invoice history."
          plan={{
            name: "Studio",
            accessibleName: "Studio summary",
            status: "Active plan",
            price: "$24",
            priceNote: "per month",
            description: "A focused plan for a small product team.",
            details: planDetailsShown
              ? [
                  { id: "period", label: "Period", value: "Monthly" },
                  { id: "currency", label: "Currency", value: "USD" },
                  {
                    id: "renewal",
                    label: "Renewal",
                    value: "No renewal connected",
                  },
                  {
                    id: "payment",
                    label: "Payment",
                    value: "No payment method",
                  },
                ]
              : [
                  { id: "period", label: "Period", value: "Monthly" },
                  { id: "currency", label: "Currency", value: "USD" },
                ],
            action: {
              kind: "link",
              id: "plan-detail",
              label: planDetailsShown
                ? "Review plan details"
                : "View plan details",
              href: `#${planDetailId}`,
              linkProps: {
                onClick: () => {
                  setPlanDetailsShown(true);
                  setMessage(
                    "Additional fictional plan details are visible locally.",
                  );
                },
              },
            },
          }}
          allowances={PERIOD_ALLOWANCES[period]}
          invoices={invoices}
          invoiceCaption="Invoice history"
          periodControl={{
            value: period,
            options: [
              { value: "current", label: "Current period" },
              { value: "previous", label: "Previous period" },
            ],
            onValueChange: (value) => {
              const nextPeriod = value === "previous" ? "previous" : "current";
              setPeriod(nextPeriod);
              setMessage(
                nextPeriod === "current"
                  ? "Current fictional usage period selected."
                  : "Previous fictional usage period selected.",
              );
            },
          }}
          footer={
            <span>
              <span role="status" aria-live="polite">
                {message}
              </span>{" "}
              Sample billing data. No charge, purchase, or stored change occurs.
            </span>
          }
        />

        <div className="billing-overview-demo-details">
          <div id={planDetailId}>
            {planDetailsShown ? (
              <article tabIndex={-1}>
                <span>Plan detail</span>
                <h3>Studio</h3>
                <p>The expanded terms are now visible in the plan summary.</p>
              </article>
            ) : null}
          </div>
          <div id={invoicePreviewId}>
            {selectedInvoice ? (
              <article tabIndex={-1}>
                <span>Invoice preview</span>
                <h3>{selectedInvoice.label}</h3>
                <p>{selectedInvoice.note}</p>
                <dl>
                  <div>
                    <dt>Date</dt>
                    <dd>{selectedInvoice.date}</dd>
                  </div>
                  <div>
                    <dt>Total</dt>
                    <dd>{selectedInvoice.total}</dd>
                  </div>
                </dl>
              </article>
            ) : null}
          </div>
        </div>
      </div>
    </section>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <BillingOverviewDemo />
    </div>
  );
}

```

## Gotchas

- The host application owns data, validation, persistence, navigation, and service side effects described by this API.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Tab and Shift+Tab follow the component's native focus order.","Arrow-key behavior follows the exported composite-control implementation."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

title, typed consumer-owned plan, allowances, invoices and accessible invoiceCaption are required. Plan data includes visible name/status/price, optional description/details and one native link/button action. Allowances supply labelled used/limit progress, visible value copy and optional native card/progress attributes and refs; rendered progress clamps invalid and out-of-range geometry. Invoices render in a native captioned table with column/row headers and required native destination links. Optional controlled periodControl invokes its native select handler first and suppresses the higher callback when prevented; defaultValue is excluded. Root/plan/allowance/progress/period/table/scroll/row/destination/action attributes and refs pass through with React 19 callback-ref cleanup on the scroll surface. Disabled action links suppress caller handling/navigation while explicit false is preserved; native button onClick runs before the preventable higher action. Headings, allowance/invoice/count labels, empty states and footer are consumer-owned. The component performs no charge, purchase, checkout, cancellation, billing request, account, network, storage or persistence action.
