Chart style

Applies to every chart.

Palette

Theme

Appearance

Depth
Surface
Background

Reading & motion

Axis
Hover
Legend
Numbers
Loading
Empty
Using chart defaults
3,174npm
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

Depth chart

SOL · USDC

$182.41$182.41Mid price
Spread
$0.25 (0.137%)
Bid depth
13K
Ask depth
13.9K
Mid $182.41$178.53$182.53
Default01 / 01

Usage

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

import { DepthChartCard } from '@lilt-ui/charts/finance';
import '@lilt-ui/charts/styles.css';
<DepthChartCard
  title="SOL · USDC"
  bids={book.bids}
  asks={book.asks}
  valueFormat={{ style: 'currency', currency: 'USD' }}
/>

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

Bids accumulate from the best (highest) bid down and asks from the best (lowest) ask up, so each curve shows how much size rests between the mid and a price. Orders at the same price merge. A crossed book, with a bid at or above an ask, throws rather than drawing a misleading spread. depthLevels returns the same cumulative levels, mid and spread for your own layouts.

// Resting orders: a price and the size at it, in any order.
const book = {
  bids: [
    { price: 182.28, size: 1050 },
    { price: 182.03, size: 626 },
  ],
  asks: [
    { price: 182.53, size: 356 },
    { price: 182.78, size: 1793 },
  ],
};

<DepthChartCard title="SOL · USDC" bids={book.bids} asks={book.asks} />

Props

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

PropTypeDescription
headerbooleanFalse removes the title, midpoint and summary stats. Defaults to true.
aria-labelstringAccessible name, independent of the visible title.
titlestringOptional visible title. Also names the chart unless aria-label is set.
bids{ price, size }[]Resting buy orders, in any order.
asks{ price, size }[]Resting sell orders, in any order.
valueFormatIntl.NumberFormatOptionsPrice format for the mid, spread and axis. Defaults to US dollars.
sizeFormatIntl.NumberFormatOptionsSize format for depth. Compact numbers by default.
heightnumberPlot height in pixels. Defaults to 220.
background'dots' | 'grid' | 'lines' | 'none'Texture behind the depth areas.
axis'minimal' | 'dots' | 'inline' | 'ruler' | 'classic' | 'segmented'Axis preset.
hoverStyle'soft' | 'solid' | 'accent'How the pills look.
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.
depthbooleanDraws both sides' edges as lit tubes with a soft shadow; every step keeps its exact price.
localestringLocale used for number formatting. Defaults to en-US.
classNamestringAdditional class on the card frame.
styleCSSProperties | ChartStyleInline styles and scoped --lilt-* chart variables.
numberStyle'count' | 'pop' | 'slide' | 'roll' | 'flow' | 'scramble'Headline number animation. Defaults to count; motion settings take precedence.