Candlestick Chart

Live OHLC candles with volume, a last-price line, and a crosshair readout.

Preview

ETH / USD · 5mSimulated
Candle
15:55
O
2,360.34
H
2,369.93
L
2,351.12
C
2,368.44
Vol
151.2
+0.34%

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/candlestick-chart

API Reference

CandlestickChart

candles
readonly Candle[]
—
lastPrice?
number

Draws a dashed line and tag at this price, usually the last trade.

—
activeId?
string | null

Controlled crosshair candle, by `id`, so it stays on the same candle as new ones arrive. Pair with `onActiveIdChange`.

—
defaultActiveId?
string | null
—
onActiveIdChange?
((id: string | null) => void)
—
formatPrice?
((value: number) => string)
—
formatVolume?
((value: number) => string)
—
label?
string

Accessible name for the chart.

—
className?
string
—

CandlestickChartLegend

children?
((candle: Candle, change: number) => ReactNode)

Custom readout. Receives the crosshair candle, or the latest one.

—
className?
string
—

CandlestickChartPlot

height?
number

Plot height in px.

320
className?
string
—

Updated