# App, invoice list

- **[Sections](/blocks/)**
- **[Application](/blocks/app/)**
- **App, invoice list**

A list of invoices as a table: number, date, amount, a status badge (paid, due, failed: always a word) and a download link named for its invoice that stays in view…

## Import

- **CLI**

  ```
  npx shadcn add @klarhimmel/app-billing-invoices
  ```
- **Import**

  ```
  import Block from '@/components/klarhimmel/blocks/app-billing-invoices';
  ```

Also called

- app/billing-invoices

- **About**: A list of invoices as a table: number, date, amount, a status badge (paid, due, failed: always a word) and a download link named for its invoice that stays in view while the other columns scroll, and a failed invoice that can be paid…
- **Category**: Interface sections for signed-in products. New project? Set it up once: /get-started/installation.

## Notes

- **When to use it**: A table of past invoices with status and a download link per row, for a billing page. For the current plan and usage use `app-billing-plan`; for a generic table of other data use `app-data-table`.
- **Writing for it**: - Rows take 1 to 8 entries. Each has a number, date and amount of 30 characters at most, a status of paid, due or failed, and an `href` for the download file.
- Set `download` (30) to a short verb like Download; the invoice number is appended for screen readers so the link is not just the same word eight times.
- Use `recovery` only for failed rows: `payAgain` and an `updateCard` link appear there, and `said` (80) is the announcement after a retry.
- **Watch out for**: Eight rows is the ceiling, so a long history needs `app-data-pagination` or a link elsewhere. In the empty state `messages.emptyTitle` is required, and the Pay again button only changes the row to processing locally; it does not charge anything.

## Pairs well with

- **[App, plan and usage](/blocks/app/billing-plan)**
- **[App, profile settings](/blocks/app/settings-profile)**
- **[App, pagination](/blocks/app/data-pagination)**

## Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx

```
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import AppBillingInvoices from '@/components/klarhimmel/blocks/app-billing-invoices';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <AppBillingInvoices props={{
          "eyebrow": "Billing",
          "title": "Invoices",
          "description": "Say whose invoices these are and what can be done with one.",
          "caption": "Name the list and its order",
          "columns": {
            "number": "Invoice",
            "date": "Date",
            "amount": "Amount",
            "status": "Status"
          },
          "rows": [
            {
              "number": "XXX-0001",
              "date": "1 Jan 0000",
              "amount": "$00",
              "status": "due",
              "href": "#inv-1042"
            }
          ],
          "statusLabels": {
            "paid": "Paid",
            "due": "Due",
            "failed": "Failed"
          },
          "download": "Download PDF",
          "scrollHint": "Say there are more columns",
          "recovery": {
            "payAgain": "Pay again",
            "updateCard": {
              "label": "Update card",
              "href": "#card"
            },
            "processing": "Processing",
            "said": "Say that a new attempt started and where the result is sent."
          },
          "state": "filled",
          "messages": {
            "emptyTitle": "No invoices yet",
            "emptyBody": "Say when the first item will appear here and what causes it."
          }
        }} />
      </BlockSurface>
    </Theme>
  );
}
```

## Props

The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.

- **eyebrow**: Text, up to 60 characters. Optional; empty is not rendered.
- **title**: Text, up to 120 characters.
- **description**: Text, up to 300 characters. Optional; empty is not rendered.
- **caption**: Text, up to 80 characters.
- **columns**: Fields: number, date, amount, status.
- **rows**: List of 1 to 8. Each item: number, date, amount, status ('paid' | 'due' | 'failed'), href.
- **statusLabels**: Fields: paid, due, failed.
- **download**: Text, up to 30 characters.
- **scrollHint**: Text, up to 40 characters.
- **recovery**: Fields: payAgain, updateCard, processing, said.
- **state**: One of 'filled', 'empty'.
- **messages**: Fields: emptyTitle, emptyBody.
- **headingLevel**: One of '1', '2'. Optional; empty is not rendered.

[Previous](/blocks/app/auth-signup)

[Next](/blocks/app/billing-plan)
