Candlestick Chart

Preview

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[]
Default—
lastPrice?
number

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

Default—
activeId?
string | null

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

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

Accessible name for the chart.

Default—
labels?
Partial<{ label: string; candle: string; open: string; high: string; low: string; close: string; volume: string; valueText: string; }>

Override any built-in string.

Default—
className?
string
Default—

CandlestickChartLegend

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

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

Default—
className?
string
Default—

CandlestickChartPlot

height?
number

Plot height in px.

Default320
className?
string
Default—

Updated