Skip to content
Charts55Components12Visuals14ASCII45
GitHubGet startedGet started
All chartsOrder bookFinance
PreviousNext: Portfolio

FinanceFI-05

Order book

Resting orders level by level, the best prices meeting in the middle.

Part
FI-05
Component
OrderBook
From
@lilt-ui/charts/finance
SOL order book
PriceSizeTotal
184.282016.9K
184.033876.7K
183.787946.3K
183.531K5.5K
183.288344.5K
183.031.5K3.7K
182.781.8K2.1K
182.53356356
182.41Spread 0.25 · 0.137%
182.281.1K1.1K
182.036261.7K
181.782071.9K
181.531892.1K
181.289423K
181.031.3K4.3K
180.789915.3K
180.535615.9K
Default01 / 01

Installation

One package, one sheet.

Add the package, then import the component and the stylesheet once. See Getting started for theming.

$npm install @lilt-ui/charts
import { OrderBook } from '@lilt-ui/charts/finance';
import '@lilt-ui/charts/styles.css';

Usage

The default card.

The default card above, as you would write it.

<OrderBook title="SOL order book" bids={book.bids} asks={book.asks} />

Omit title to leave out the visible title. Set header={false} to remove the whole header, and use aria-label to name a chart inside your own card. surface="ghost" controls only the visual frame. See Card composition.

Data

The shape it reads.

The ladder shows the best levels on each side: asks above, highest first, and bids below, so the best prices meet at the spread row. Each level’s bar is its running total from the spread outward. Pass new bids and asks as the book updates and changed levels flash once; reduced motion turns that off.

const book = {
  bids: [{ price: 182.28, size: 1050 } /* …resting buy orders */],
  asks: [{ price: 182.53, size: 356 } /* …resting sell orders */],
};

<OrderBook title="SOL order book" bids={book.bids} asks={book.asks} levels={8} />

Props18

Every prop.

Every prop OrderBook accepts, in the order you are likely to reach for them.

PropTypeDescription
headerbooleanFalse removes the caption; column headings remain. Defaults to true.
aria-labelstringAccessible name, independent of the visible title.
titlestringOptional visible table caption. Also names the card unless aria-label is set.
bids{ price, size }[]Resting buy orders, in any order.
asks{ price, size }[]Resting sell orders, in any order.
levelsnumberLevels shown on each side of the spread. Defaults to 8.
depthbooleanDraws each level's bar as a solid block with a lit roof and a shaded end.
valueFormatIntl.NumberFormatOptionsPrice format. Two decimals by default.
sizeFormatIntl.NumberFormatOptionsSize format. Compact numbers by default.
flashbooleanHighlight levels whose size changed. Defaults to true.
surface'elevated' | 'outline' | 'ghost'Card treatment.
loadingbooleanShows a neutral loading skeleton, not data.
loadingStyle'shimmer' | 'draw' | 'breathe'Shimmer sweeps a highlight over still shapes; draw reveals them in order; breathe lets them settle. Follows the selected look, including depth, and respects reduced motion.
empty'dots' | 'shape' | ReactElement | nullWhat the card shows when the period has no data. Dots (default) gathers a quiet dot field around the message; shape lays the chart’s own outline behind it. Pass `<ChartEmpty>` with your own words, any element of your own, or null for nothing. Both looks stay still, so empty never reads as loading, and the headline reads a dash, never zero.
motion'auto' | 'none'None turns off decorative motion.
localestringLocale used for number formatting. Defaults to en-US.
classNamestringAdditional class on the card frame.
styleCSSProperties | ChartStyleInline styles and scoped --lilt-* chart variables.
Previous chartDepthNext chartPortfolio

Ready when your data is. Start with one install.

Install a package, import the stylesheet once, and drop in a card or a scene.

Read the guideRead the guideView on GitHubView on GitHub
ChartsAll chartsAll chartsFinanceFinanceCustomizeCustomizeFeaturesFeatures
ComponentsAll componentsAll componentsAIAIStatusStatusActionsActionsDataData
VisualsAll visualsAll visualsAIAIDataDataSecuritySecurityProductProduct
ASCIIAll scenesAll scenesTextTextInterfaceInterfaceBackgroundsBackgroundsMediaMediaDataData
DocsGetting startedGetting startedAPI referenceAPI referenceMotion & accessibilityMotion & accessibilityllms.txtllms.txt
React components with a little lilt.GitHubGitHubnpmnpm