---
title: "Currency Swap Orders"
description: "Lists the limit orders and recurring plans of a swap. Open orders show how much is filled and a Cancel that asks first, and done ones go to history."
url: https://gelatinui.com/components/currency-swap-orders
markdown_url: https://gelatinui.com/components/currency-swap-orders.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/currency-swap-orders"
version: "2026-11-12"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Currency Swap Orders

> Lists the limit orders and recurring plans of a swap. Open orders show how much is filled and a Cancel that asks first, and done ones go to history.

Page: https://gelatinui.com/components/currency-swap-orders

## When to use it

Best for: The list beside a Currency Swap: open orders and plans with Cancel, and their history.

- Use it next to a Currency Swap that places limit orders or recurring plans.
- Pass `onCancel`; a promise keeps the confirm busy, and an error shows a toast.

## When not to use it

- For a table with sort and filters, use a [Data Table](https://gelatinui.com/components/data-table.md).
- For the swap form, use [Currency Swap](https://gelatinui.com/components/currency-swap.md).

## Notes for agents

- Required: `orders` (`PlacedOrder[]`). `tab` or `defaultTab` (`open`, `history`) picks the list; each tab shows its count.
- An item shows both marks, the amount and codes, the price or plan, the status, and the fill of a limit order.
- Cancel shows only on open orders and only with `onCancel`. It asks first in an Alert Dialog.
- Parts: `CurrencySwapOrdersTabs`, `CurrencySwapOrdersList`, `CurrencySwapOrdersItem`, `CurrencySwapOrdersCancel`, and `CurrencySwapOrdersEmpty`.

## Anatomy

```text
CurrencySwapOrders
├─ CurrencySwapOrdersTabs (0..n)
├─ CurrencySwapOrdersList (0..n)
├─ CurrencySwapOrdersItem (0..n)
│  ├─ CurrencySwapOrdersItemMedia (0..n)
│  └─ CurrencySwapOrdersItemActions (0..n)
├─ CurrencySwapOrdersItemTitle (0..n)
├─ CurrencySwapOrdersItemStatus (0..n)
├─ CurrencySwapOrdersItemFill (0..n)
├─ CurrencySwapOrdersCancel (0..n)
└─ CurrencySwapOrdersEmpty (0..n)
```

## API reference

### CurrencySwapOrders

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` |  | The parts. Default: the tabs and the list. |
| `orders` | `readonly PlacedOrder[]` |  | Every limit order and plan the app placed, newest first. |
| `onCancel` | `function` |  | Cancels an open order or stops a plan. A rejection shows an error Toast. |
| `tab` | `"history" \| "open"` |  | The tab (controlled). |
| `defaultTab` | `"history" \| "open"` | "open" | The tab at first (uncontrolled). Default `open`. |
| `onTabChange` | `function` |  |  |
| `locale` | `string` |  |  |
| `labels` | `Partial<CurrencySwapOrdersLabels>` |  |  |
| `container` | `union` |  | Where the cancel dialogs portal to (Base UI `Portal` `container`), so a scoped app or a playground keeps them in its frame. Default: the document body. |

### CurrencySwapOrdersTabs

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Tabs.Root`: https://base-ui.com/react/components/tabs

### CurrencySwapOrdersList

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `function` |  | The row of each order of the tab, as a render function: `(order) => <CurrencySwapOrdersItem>…</CurrencySwapOrdersItem>`. The items take their order from the list. Default: a `CurrencySwapOrdersItem` with every part. |

### CurrencySwapOrdersItem

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"default" \| "sm" \| "xs"` |  |  |
| `variant` | `"default" \| "muted" \| "outline"` |  |  |
| `order` | `PlacedOrder` |  | The order. Default: the order of the list row this item renders in. |
| `children` | `ReactNode` |  | The parts. Default: the marks, the title, the status line, the fill, and Cancel. |

Also takes every prop of Base UI `UseRender`: https://base-ui.com/react/components/use-render

### CurrencySwapOrdersItemMedia

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"default" \| "icon" \| "image"` |  |  |

### CurrencySwapOrdersItemTitle

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### CurrencySwapOrdersItemStatus

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### CurrencySwapOrdersItemFill

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `low` | `number` |  | The top of the low region, as on the native `<meter>`. Set it or `high` to get levels. |
| `high` | `number` |  | The bottom of the high region, as on the native `<meter>`. |
| `optimum` | `number` |  | The best value. Under `low`: low is good. Over `high`: high is good. Between: the middle. |
| `glow` | `boolean` |  | A soft halo in the fill color (`glow`, `@gelatin-ui/glow`). Default: `false`. |

Also takes every prop of Base UI `Meter.Root`: https://base-ui.com/react/components/meter

### CurrencySwapOrdersItemActions

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### CurrencySwapOrdersCancel

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `busy` | `boolean` |  | The button waits for the app (busy words): a spinner, `aria-busy`, and no clicks. Focus stays on the button. The style hook stays `data-loading`. |
| `spinnerPlacement` | `"center" \| "start"` |  | `center` (default): the spinner covers the label. `start`: it takes the leading icon slot. The icon sizes always use `center`, because their one icon is the label. |
| `glass` | `"clear" \| "dark" \| "light"` |  |  |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "icon" \| "icon-lg" \| "icon-sm" \| "icon-xs" \| "lg" \| "sm" \| "xl" \| "xs"` |  |  |
| `variant` | `"dashed" \| "default" \| "destructive" \| "destructive-outline" \| "ghost" \| "link" \| "media" \| "outline" \| "secondary"` |  |  |
| `order` | `PlacedOrder` |  | The order. Default: the order of the item (or list row) it renders in. |
| `children` | `ReactNode` |  | The button face. Default: "Cancel". |

Also takes every prop of Base UI `Button`: https://base-ui.com/react/components/button

### CurrencySwapOrdersEmpty

No props of its own: `className`, `children`, and every other prop go to the element it renders.

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| CurrencySwapOrders | `currency-swap-orders` |  |  |  |
| CurrencySwapOrdersTabs | `currency-swap-orders-tabs` |  |  |  |
| CurrencySwapOrdersList | `currency-swap-orders-list` |  |  |  |
| CurrencySwapOrdersItem | `currency-swap-orders-item` |  |  |  |
| CurrencySwapOrdersItemMedia | `currency-swap-orders-item-media` |  |  |  |
| CurrencySwapOrdersItemTitle | `currency-swap-orders-item-title` |  |  |  |
| CurrencySwapOrdersItemStatus | `currency-swap-orders-item-status` |  |  |  |
| CurrencySwapOrdersItemFill | `currency-swap-orders-item-fill` |  |  |  |
| CurrencySwapOrdersItemActions | `currency-swap-orders-item-actions` |  |  |  |
| CurrencySwapOrdersCancel | `currency-swap-orders-cancel` |  |  |  |
| CurrencySwapOrdersEmpty | `currency-swap-orders-empty` |  |  |  |

## Usage

Put the tabs above the list: Open shows the orders people can cancel, and History shows the rest.

```tsx title="open-orders.tsx"
import {
  CurrencySwapOrders,
  CurrencySwapOrdersList,
  CurrencySwapOrdersTabs,
} from "@/components/pro/finance/currency-swap-orders";
import type { PlacedOrder } from "@/lib/pro/currency-swap-model";

export function OpenOrders({ orders }: { orders: PlacedOrder[] }) {
  return (
    <CurrencySwapOrders
      orders={orders}
      onCancel={async (order) => {
        await fetch(`/api/orders/${order.id}`, { method: "DELETE" });
      }}
    >
      <CurrencySwapOrdersTabs />
      <CurrencySwapOrdersList />
    </CurrencySwapOrders>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui-pro/currency-swap-orders
```

It adds 74 registry items: 70 files, 11931 lines, and the npm packages `@base-ui/react`, `@phosphor-icons/react`, `@xstate/react`, `clsx`, `country-flag-icons`, `decimal.js`, `motion`, `tailwind-merge`, `tailwind-variants`, `xstate`.

## Built on

- [Alert Dialog](https://gelatinui.com/components/alert-dialog.md)
- [Asset Icon](https://gelatinui.com/components/asset-icon.md)
- [Badge](https://gelatinui.com/components/badge.md)
- [Button](https://gelatinui.com/components/button.md)
- [Empty](https://gelatinui.com/components/empty.md)
- [Item](https://gelatinui.com/components/item.md)
- [Meter](https://gelatinui.com/components/meter.md)
- [Tabs](https://gelatinui.com/components/tabs.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Currency Swap](https://gelatinui.com/components/currency-swap.md)
- [Tabs](https://gelatinui.com/components/tabs.md)
- [Item](https://gelatinui.com/components/item.md)
- [Alert Dialog](https://gelatinui.com/components/alert-dialog.md)
