# Order summary

A semantic order review block with consumer-owned items, price rows, totals, and native actions, without checkout behavior.

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

## When to use

- Use it when a page needs a semantic order review block with consumer-owned items, price rows, totals, and native actions, without checkout behavior.
- 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 order summary.

## 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 Order summary

```sh
npx shadcn@latest add @tidal-pro/order-summary
```

Stylesheets: `components/ui/tidal.css`, `components/ui/order-summary.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/order-summary.css";
import{TidalOrderSummary}from"./components/ui/order-summary";
export default()=><div className="tidal-scope"><TidalOrderSummary items={[{id:"example",name:"Demo",quantity:"value",amount:"value"}]} rows={[{id:"example",label:"Demo",value:"value"}]} title={"Demo"} totalLabel={"Demo"} totalValue={"value"}/></div>;
```

## Structured props

- `TidalOrderSummary.items: ReadonlyArray<TidalOrderSummaryItem>`: Required items value accepted by this exported component.
- `TidalOrderSummary.rows: ReadonlyArray<TidalOrderSummaryRow>`: Required rows value accepted by this exported component.
- `TidalOrderSummary.title: ReactNode`: Required title value accepted by this exported component.
- `TidalOrderSummary.totalLabel: ReactNode`: Required total label value accepted by this exported component.
- `TidalOrderSummary.totalValue: ReactNode`: Required total value value accepted by this exported component.
- `TidalOrderSummary.actions?: ReadonlyArray<TidalOrderSummaryAction> | undefined` (default []): Optional actions value accepted by this exported component.
- `TidalOrderSummary.actionsLabel?: string | undefined` (default "Order summary actions"): Optional actions label value accepted by this exported component.
- `TidalOrderSummary.amountColumnLabel?: string | undefined` (default "Amount"): Optional amount column label value accepted by this exported component.
- `TidalOrderSummary.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalOrderSummary.emptyMessage?: ReactNode` (default "No items are in this sample order."): Optional empty message value accepted by this exported component.
- `TidalOrderSummary.headingLevel?: HeadingLevel | undefined` (default 2): Optional heading level value accepted by this exported component.
- `TidalOrderSummary.itemColumnLabel?: string | undefined` (default "Item"): Optional item column label value accepted by this exported component.
- `TidalOrderSummary.itemsLabel?: string | undefined` (default "Order items"): Optional items label value accepted by this exported component.
- `TidalOrderSummary.notice?: ReactNode`: Optional notice value accepted by this exported component.
- `TidalOrderSummary.quantityColumnLabel?: string | undefined` (default "Quantity"): Optional quantity column label value accepted by this exported component.
- `TidalOrderSummary.status?: ReactNode`: Optional status value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/order-summary.tsx) | [Manifest](https://tidalui.com/examples/order-summary.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, useLayoutEffect, useRef, useState } from "react";

import { TidalOrderSummary, type TidalOrderSummaryItem } from "./components/ui/order-summary";

import "./components/ui/order-summary.css";



const tidalExampleStyles = ".order-summary-demo,\n.order-summary-demo * {\n  box-sizing: border-box;\n}\n\n.order-summary-demo {\n  width: 100%;\n  min-width: 0;\n  container: order-demo / inline-size;\n}\n\n.order-summary-demo-details {\n  margin-top: 12px;\n  padding: 14px 16px;\n  border: 1px solid var(--t-border);\n  border-radius: 12px;\n  background: var(--t-subtle);\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.5;\n}\n\n.order-summary-demo-details > span {\n  color: var(--t-ink);\n  font-size: 11px;\n  font-weight: 720;\n  letter-spacing: 0.08em;\n  text-transform: uppercase;\n}\n\n.order-summary-demo-details p {\n  margin: 5px 0 0;\n  overflow-wrap: anywhere;\n}\n\n.order-summary-demo-complete {\n  display: grid;\n  width: 100%;\n  min-height: 280px;\n  place-items: center;\n  align-content: center;\n  gap: 12px;\n  padding: 30px;\n  border: 1px solid var(--t-border);\n  border-radius: 22px;\n  background: var(--t-surface);\n  color: var(--t-ink);\n  text-align: center;\n  box-shadow: 0 30px 74px -56px #0000008f;\n  animation: order-demo-complete 420ms var(--t-ease-out) both;\n}\n\n.order-summary-demo-complete > span {\n  display: grid;\n  width: 56px;\n  height: 56px;\n  place-items: center;\n  border-radius: 50%;\n  background: var(--t-ink);\n  color: var(--t-surface);\n  font-size: 22px;\n}\n\n.order-summary-demo-complete h3 {\n  max-width: 16ch;\n  margin: 4px 0 0;\n  font-size: clamp(25px, 8cqi, 40px);\n  font-weight: 560;\n  letter-spacing: -0.05em;\n  line-height: 1;\n  overflow-wrap: anywhere;\n}\n\n.order-summary-demo-complete h3:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 5px;\n}\n\n.order-summary-demo-complete p {\n  max-width: 42ch;\n  margin: 0;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.55;\n  overflow-wrap: anywhere;\n}\n\n.order-summary-demo-complete button {\n  min-width: 44px;\n  min-height: 44px;\n  padding: 10px 14px;\n  border: 1px solid var(--t-ink);\n  border-radius: 10px;\n  background: var(--t-ink);\n  color: var(--t-surface);\n  cursor: pointer;\n  font: inherit;\n  font-size: 11px;\n  font-weight: 690;\n}\n\n.order-summary-demo-complete button:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 3px;\n}\n\n@container order-demo (max-width: 420px) {\n  .order-summary-demo-complete {\n    padding: 22px 16px;\n  }\n\n  .order-summary-demo-complete button {\n    width: 100%;\n    font-size: 16px;\n  }\n}\n\n@media (hover: none), (pointer: coarse) {\n  .order-summary-demo-complete button {\n    font-size: 16px;\n  }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .order-summary-demo-complete {\n    animation: none;\n  }\n}\n\n@keyframes order-demo-complete {\n  from {\n    opacity: 0;\n    transform: translateY(12px);\n  }\n}";

const SAMPLE_ITEMS: readonly TidalOrderSummaryItem[] = [
  {
    id: "workspace",
    name: "Workspace plan",
    description: "One month in this local sample.",
    unitPrice: "$29.00 each",
    quantity: "1",
    amount: "$29.00",
    media: <span aria-hidden="true">W</span>,
  },
  {
    id: "contributors",
    name: "Contributor seats",
    description: "Two fictional sample seats.",
    unitPrice: "$8.00 each",
    quantity: "2",
    amount: "$16.00",
    media: <span aria-hidden="true">2</span>,
  },
  {
    id: "archive",
    name: "Archive add-on",
    description: "Sample document retention display.",
    unitPrice: "$8.00 each",
    quantity: "1",
    amount: "$8.00",
    media: <span aria-hidden="true">A</span>,
  },
];

export function OrderSummaryDemo() {
  const instanceId = useId().replace(/:/g, "");
  const detailsId = `order-sample-details-${instanceId}`;
  const [creditApplied, setCreditApplied] = useState(false);
  const [reviewed, setReviewed] = useState(false);
  const reviewButtonRef = useRef<HTMLButtonElement>(null);
  const completeHeadingRef = useRef<HTMLHeadingElement>(null);
  const shouldFocusComplete = useRef(false);
  const shouldFocusReview = useRef(false);

  useLayoutEffect(() => {
    if (!reviewed || !shouldFocusComplete.current) return;
    shouldFocusComplete.current = false;
    completeHeadingRef.current?.focus({ preventScroll: true });
  }, [reviewed]);

  useLayoutEffect(() => {
    if (reviewed || !shouldFocusReview.current) return;
    shouldFocusReview.current = false;
    reviewButtonRef.current?.focus({ preventScroll: true });
  }, [reviewed]);

  if (reviewed) {
    return (
      <section className="order-summary-demo-complete">
        <span aria-hidden="true">✓</span>
        <h3 ref={completeHeadingRef} tabIndex={-1}>
          Sample order ready for review
        </h3>
        <p>
          The preview total is {creditApplied ? "$48.00" : "$53.00"}. No payment
          or order was submitted.
        </p>
        <button
          type="button"
          onClick={() => {
            shouldFocusReview.current = true;
            setReviewed(false);
          }}
        >
          Adjust sample order
        </button>
      </section>
    );
  }

  return (
    <section className="order-summary-demo" aria-label="Order sample preview">
      <TidalOrderSummary
        title="Workspace order"
        description="Review a fictional workspace configuration before the sample confirmation step."
        status="Sample prices"
        items={SAMPLE_ITEMS.map((item) =>
          item.id === "workspace" ? { ...item, href: `#${detailsId}` } : item,
        )}
        rows={[
          { id: "subtotal", label: "Subtotal", value: "$53.00" },
          {
            id: "credit",
            label: "Sample credit",
            detail: creditApplied ? "Applied locally" : "Not applied",
            value: creditApplied ? "−$5.00" : "$0.00",
            emphasis: creditApplied ? "strong" : "normal",
          },
        ]}
        totalLabel="Sample total"
        totalValue={creditApplied ? "$48.00" : "$53.00"}
        notice="Fictional USD display values. This preview cannot charge, order, or store payment details."
        actions={[
          {
            kind: "button",
            id: "credit",
            label: creditApplied
              ? "Remove sample credit"
              : "Apply sample credit",
            buttonProps: { "aria-pressed": creditApplied },
            onAction: () => setCreditApplied((current) => !current),
          },
          {
            kind: "link",
            id: "details",
            label: "Review item details",
            href: `#${detailsId}`,
          },
          {
            kind: "button",
            id: "review",
            label: "Review sample order",
            emphasis: "primary",
            buttonRef: reviewButtonRef,
            onAction: () => {
              shouldFocusComplete.current = true;
              setReviewed(true);
            },
          },
        ]}
      />

      <aside id={detailsId} className="order-summary-demo-details">
        <span>Sample item details</span>
        <p>
          The plan, seats, add-on, credit, and totals exist only in this local
          preview.
        </p>
      </aside>
    </section>
  );
}

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

```

## Gotchas

- Install the declared registry dependencies and render inside a tidal-scope with the foundation stylesheet loaded.

## 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."],"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 names the section and headingLevel defaults to h2. description, status, notice, emptyMessage, item media and all labels are consumer content and preserve numeric zero. items is an ordered list of unique IDs with name, optional description/media/unitPrice, quantity and amount; an optional real href accepts native anchor attributes and a ref, while linkDisabled or aria-disabled true suppresses navigation before the consumer click handler. rows is an ordered list of unique IDs with label, value, optional detail and emphasis. totalLabel and totalValue are required. actions is an ordered list of unique IDs containing native buttons with caller-first preventable click handling or real anchors preserving modifiers, download and target; both support matching native attributes and refs, visible labels, optional accessible labels, emphasis and disabled state. The source owns no prices, calculations, checkout, payment, requests, navigation, timers, focus, storage or account state.
