Chart style

Applies to every chart.

Palette

Theme

Appearance

Depth
Surface
Background

Reading & motion

Axis
Hover
Legend
Numbers
Loading
Empty
Using chart defaults
3,109npm
1stars

Charts

Every chart, by the job it does

Trends3

  • Area
  • Line
  • Combo

Comparison4

  • Bar
  • Horizontal bar
  • Slope
  • RangeNew

Part of a whole4

  • Radial
  • Treemap
  • Funnel
  • Sankey

KPIs3

  • Stat cards
  • Progress
  • Activity ring

Patterns4

  • Heatmap
  • Scatter
  • Radar
  • Box plotNew

Cool23

  • Chord loomNew
  • Rank ribbonsNew
  • Event helixNew
  • Contour islandsNew
  • Parallel ribbonsNew
  • Sunburst terracesNew
  • Cluster constellationNew
  • Ternary prismNew
  • Wind roseNew
  • Marimekko blocksNew
  • Intersection towersNew
  • Horizon foldsNew
  • Circle archipelagoNew
  • Helix ribbonsNew
  • Voxel cloudNew
  • Arc bridgesNew
  • TerrainNew
  • Hex cityNew
  • Voxel waffleNew
  • SkylineNew
  • Block cityNew
  • RidgelineNew
  • Spiral yearNew

Finance6

  • CandlestickNew
  • IndicatorsNew
  • PriceNew
  • DepthNew
  • Order bookNew
  • PortfolioNew

Order book

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

Usage

Import the component and the stylesheet once. See Getting started to install the package.

import { OrderBook } from '@lilt-ui/charts/finance';
import '@lilt-ui/charts/styles.css';
<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 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} />

Props

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.