Skip to content

Orders ledger

Orders table with sortable columns and row selection.

Usage

Usage
import { OrdersTable } from '@/components/blocks/table-01'


<OrdersTable />


// Bring your own rows and handle actions
<OrdersTable
  title="Recent orders"
  rows={[
    {
      id: 'PR-1001',
      customer: 'Jane Doe',
      company: 'Acme',
      product: 'Posters, A2',
      status: 'success',
      quantity: 100,
      unitPrice: 2.5,
    },
  ]}
  onRowAction={(action, row) => console.log(action, row.id)}
  onExport={(rows) => console.log(rows)}
/>

Install

pnpm dlx shadcn@latest add @pastaui-pro/table-01

Source

Props

Orders ledger props
PropTypeDefaultDescription
titlestring= 'Recent print orders'Panel heading, also used for the table caption.
descriptionstring= 'Orders placed with the studio in the last 30 days.'Shown on the info icon and read out in the table caption.
rowsPrintOrder[]= 12 sample ordersRows with an id, customer, optional company, product, status, quantity and unitPrice. The total is quantity times unit price.
currencystring= 'USD'Currency code for prices and totals.
localestring= 'en-US'Locale used to format money.
statusLabelsPartial<Record<'success' | 'pending' | 'refunded', string>>= { success: 'Success', pending: 'Pending', refunded: 'Refunded' }Text shown in the status badges (success, pending, and refunded use the success, pending, and expired badge styles). Search matches these labels too.
searchPlaceholderstring= 'Search orders…'Placeholder for the search field.
emptyStatestring= 'No orders found'Heading shown when the search matches no rows.
onRowAction(action: 'view' | 'refund' | 'copy', row: PrintOrder) => void= —Called from the row menu. Copy ID also copies the ID to the clipboard, and Refund is disabled for refunded orders.
onExport(rows: PrintOrder[]) => void= Downloads orders.csvCalled from the more menu with the rows currently shown.
classNamestring= —Additional classes for the section.
styleCSSProperties= —Inline styles, handy for overriding the --pp-* color variables.