Order book
Bids and asks as depth bars around the spread.
Spread 0.20Mid 100.00
| Side | Price | Size | Cumulative |
|---|---|---|---|
| Ask | 100.50 | 178 | 670 |
| Ask | 100.40 | 156 | 492 |
| Ask | 100.30 | 134 | 336 |
| Ask | 100.20 | 112 | 202 |
| Ask | 100.10 | 90 | 90 |
| Bid | 99.90 | 120 | 120 |
| Bid | 99.80 | 102 | 222 |
| Bid | 99.70 | 84 | 306 |
| Bid | 99.60 | 66 | 372 |
| Bid | 99.50 | 48 | 420 |
When to use
- Market screens showing resting orders.
- Anywhere two sides meet at a price.
When not to use
- There is only one side.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/order-book
Adds its 5 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
OrderBook
9 props
PropTypeDefault
label *string—
bids *readonly BookLevel[]—
asks *readonly BookLevel[]—
levelsnumber8
formatPrice((price: number) => string)(price) => price.toFixed(2)
formatSize((size: number) => string)numberText
loadingboolean—
errorstring—
classNamestring—
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It exposes group and status semantics, with aria-label, aria-hidden and aria-busy kept in step with state. Changes that matter are announced through a live region.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/order-book.mdThe index of every part is at /llms.txt.