Orders Table

Orders with fulfilment status and line items that open in place.

PROGet Orders Table and 168 other Pro components with pro lifetime — Get Pro

Category
Data Tables
Access
Pro
Source
218 lines · one file
States
7 drawn
Kind
Block

The decision inside it

The breakdown is one click, not one page

Checking what was in an order is the most common reason to open it, so the lines open under the row. The chevron is its own button; the rest of the row still opens the order.

When to use it

Use Orders Table for orders with fulfilment status, where each row opens in place to its line items. Totals are worked out from the lines. For payments without line items use Payments Table.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Liro's Orders Table for this.
Install it: npx shadcn@latest add @liro/orders-table
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/orders-table.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @liro registry with your CLI token: see the Namespaced tab.

Usage

components/orders.tsx
import { OrdersTable, type Order } from "@/components/ui/orders-table";

export function Orders({ rows }: { rows: Order[] }) {
  return (
    <OrdersTable
      rows={rows}
      currency="USD"
      onBulkAction={(action, selected) => console.info(action, selected.map((o) => o.number))}
    />
  );
}

API reference

“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

TypeNotes
rowsOrder[] Yes–
currencystring NoISO 4217 code. Default "USD".
loadingboolean No–
errorReact.ReactNode No–
onRetry() => void No–
onRowClick(row: Order) => void No–
selectableboolean NoCheckboxes and the bulk bar. Default true.
onBulkAction(action: OrderBulkAction, rows: Order[]) => void No–
density"comfortable" | "compact" No–
variant"default" | "striped" | "bordered" No–
pageSizenumber NoRows per page. Default 8.
classNamestring No–

Dependencies

npm packages

lucide-react

Liro foundations, installed alongside it

liro-themebadgebuttondata-table

States

All of them are drawn by the component. None is left for you to design.

  • All orders
  • Row opened to line items
  • Unfulfilled queue
  • Compact, striped
  • Loading
  • Empty
  • Error

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances