> For the complete documentation index, see [llms.txt](https://developer.firmhouse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.firmhouse.com/sdks/headless-react/components/ordersummary.md).

# OrderSummary

The `OrderSummary` component is a summary component that displays the total price of the order. You can use this component to show the total price of the order.

### Props <a href="#props-3" id="props-3"></a>

#### className `string?` <a href="#classname-string-2" id="classname-string-2"></a>

The class name that is applied to the summary element. This prop is optional, and it defaults to an empty string.

#### fallback `React.ReactNode?` <a href="#fallback-reactreactnode-3" id="fallback-reactreactnode-3"></a>

A fallback component that is shown while the data is loading. This prop is optional, and it defaults to `null`.

#### OrderSummaryUIComponent `React.ComponentType<`[OrderSummaryUIProps](https://github.com/firmhouse/firmhouse-sdk/blob/alpha/packages/headless-react/src/lib/components/order-summary-ui.tsx#L6-L19)`>?` <a href="#ordersummaryuicomponent-reactcomponenttypeordersummaryuiprops" id="ordersummaryuicomponent-reactcomponenttypeordersummaryuiprops"></a>

A custom component that is used to render the order summary. This prop is optional, and it defaults to the [`OrderSummaryUI`](https://github.com/firmhouse/firmhouse-sdk/blob/alpha/packages/headless-react/src/lib/components/order-summary-ui.tsx) component. This component receives the necessary data to render the order summary.

### Example <a href="#example-1" id="example-1"></a>

```jsx
import { formatCentsWithCurrency } from "@firmhouse/firmhouse-sdk";

function CustomOrderSummaryUI({
  totalAmount,
  totalTaxAmount,
  cart,
  children,
  currency,
  t,
}) {
  return (  
    <div>
      <div>
        <p>{t?.("orderSummary.toPayNow")}</p>
        <p>
          <span>{t?.("orderSummary.subtotal")}</span>
          <span>
            {formatCentsWithCurrency(totalAmount, currency, locale ?? cart?.locale)}
          </span>
        </p>
        <p>
          <span>
            {t?.("orderSummary.shippingCost")}
          </span>
          <span>{t?.("orderSummary.free")}</span>
        </p>
        <p>
          <span>{t?.("orderSummary.total")}</span>
          <span>
            {formatCentsWithCurrency(totalAmount, currency, locale ?? cart?.locale)}
          </span>
        </p>
        <p>
          <span>
            {t?.("orderSummary.tax", {
              amount: formatCentsWithCurrency(
                totalTaxAmount ?? 0,
                currency,
                locale ?? cart?.locale
              ),
            })}
          </span>
        </p>
        {children}
      </div>
    </div>
  );
}

<OrderSummary OrderSummaryUIComponent={CustomOrderSummaryUI} />
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.firmhouse.com/sdks/headless-react/components/ordersummary.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
