Calm motion: animations on this site only fade, with no movement
Order book
The bids and asks of a market, with depth bars and the spread
Shows the open orders of a market on a trading screen. A bid is an offer to buy, and an ask is an offer to sell. For the history of the price, use the candlestick.
Basic
| Ask / Bid | Price | Size | Total |
|---|---|---|---|
| Ask | 1,844.00 | 3.3 | 18.1 |
| Ask | 1,843.25 | 6.2 | 14.8 |
| Ask | 1,842.00 | 1.5 | 8.6 |
| Ask | 1,841.50 | 4 | 7.1 |
| Ask | 1,840.75 | 2.2 | 3.1 |
| Ask | 1,840.25 | 0.9 | 0.9 |
| Spread 0.75 (0.041%) | |||
| Bid | 1,839.50 | 1.2 | 1.2 |
| Bid | 1,839.00 | 3.4 | 4.6 |
| Bid | 1,838.25 | 0.8 | 5.4 |
| Bid | 1,837.50 | 5.1 | 10.5 |
| Bid | 1,836.00 | 2.6 | 13.1 |
| Bid | 1,835.75 | 7.3 | 20.4 |
bidsandasksare lists of levels. Each level has apriceand asize. The order of the lists does not matter.- The asks are on top and the bids are below. The best price of each side is next to the spread line in the middle.
- Each row shows the price, the size, and the running total from the best price. A bar behind the row grows with the total, so the depth of the market shows at a glance.
- The spread line shows the gap between the best ask and the best bid, and that gap as a percent of the middle price.
depthsets the rows on each side (default 8).precisionsets the decimals of the price (default 2), andlocalesets the format.- The book is a table, and the first cell of each row says "Ask" or "Bid". The color only repeats the side. Change the words with
labelsor a label pack:title,price,size,total,ask,bid, andspread(a function).
The bookSides function sorts and totals the levels. It is exported for your own views.
Usage
ts
import { BlessOrderBook } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
bids* | BlessBookLevel[] | — | |
asks* | BlessBookLevel[] | — | |
depth | number | 8 | rows on each side |
precision | number | 2 | decimals of the price |
locale | string | "en" | |
labels | Partial<{ title: string; price: string; size: string; total: string; ask: string; bid: string; spread: (value: string, percent: string) => string; }> | — |