Skip to content
WunderUI

Candlestick Chart

Pro

Candlestick chart for prices: candles, hollow candles, OHLC bars, volume, moving averages, Heikin-Ashi, an order-book depth chart and Renko, on a right-hand price axis.

Playground Candlestick Charts

WUI / USD

Candlestick chart, 66 points from Aug 24 to Oct 28. Close from $52.79 to $61.54, lowest $52.79, highest $63.35; Volume from $36,589.00 to $30,147.00, lowest $18,657.00, highest $53,898.00.
WUI / USD, data table
dateCloseVolume
Aug 24$52.79$36,589.00
Aug 25$54.12$46,498.00
Aug 26$53.98$47,417.00
Aug 27$53.94$33,586.00
Aug 28$54.57$37,048.00
Aug 29$55.15$44,122.00
Aug 30$55.53$52,386.00
Aug 31$55.36$53,100.00
Sep 1$56.77$44,626.00
Sep 2$58.21$33,438.00
Sep 3$57.70$53,898.00
Sep 4$58.53$45,707.00
Sep 5$57.87$47,704.00
Sep 6$59.39$34,003.00
Sep 7$59.82$50,858.00
Sep 8$59.93$44,968.00
Sep 9$60.51$38,256.00
Sep 10$60.74$36,020.00
Sep 11$61.00$41,548.00
Sep 12$60.16$37,258.00
Sep 13$61.06$34,325.00
Sep 14$61.01$35,559.00
Sep 15$60.73$35,898.00
Sep 16$61.84$52,024.00
Sep 17$63.35$45,876.00
Sep 18$63.14$51,347.00
Sep 19$61.97$34,038.00
Sep 20$61.86$24,886.00
Sep 21$61.39$29,685.00
Sep 22$61.65$19,787.00
Sep 23$62.11$34,708.00
Sep 24$62.22$26,533.00
Sep 25$62.32$26,327.00
Sep 26$61.25$32,996.00
Sep 27$60.97$18,657.00
Sep 28$60.98$24,256.00
Sep 29$60.02$27,546.00
Sep 30$59.29$37,073.00
Oct 1$60.16$24,718.00
Oct 2$60.26$19,446.00
Oct 3$60.47$28,991.00
Oct 4$61.11$23,770.00
Oct 5$60.59$24,470.00
Oct 6$61.22$26,027.00
Oct 7$60.94$25,064.00
Oct 8$60.20$27,814.00
Oct 9$60.24$26,904.00
Oct 10$58.95$36,428.00
Oct 11$58.42$25,296.00
Oct 12$59.16$34,776.00
Oct 13$58.24$37,141.00
Oct 14$59.04$36,223.00
Oct 15$59.22$24,123.00
Oct 16$59.67$32,265.00
Oct 17$58.45$30,180.00
Oct 18$58.69$23,512.00
Oct 19$59.56$19,111.00
Oct 20$59.57$31,629.00
Oct 21$59.49$33,544.00
Oct 22$59.63$31,612.00
Oct 23$59.73$22,074.00
Oct 24$60.66$23,770.00
Oct 25$61.48$33,796.00
Oct 26$60.17$35,973.00
Oct 27$60.76$34,905.00
Oct 28$61.54$30,147.00

Playground Candles

WUI / USD

Candlestick chart, 66 points from Aug 24 to Oct 28. Close from $52.79 to $61.54, lowest $52.79, highest $63.35.
WUI / USD, data table
dateClose
Aug 24$52.79
Aug 25$54.12
Aug 26$53.98
Aug 27$53.94
Aug 28$54.57
Aug 29$55.15
Aug 30$55.53
Aug 31$55.36
Sep 1$56.77
Sep 2$58.21
Sep 3$57.70
Sep 4$58.53
Sep 5$57.87
Sep 6$59.39
Sep 7$59.82
Sep 8$59.93
Sep 9$60.51
Sep 10$60.74
Sep 11$61.00
Sep 12$60.16
Sep 13$61.06
Sep 14$61.01
Sep 15$60.73
Sep 16$61.84
Sep 17$63.35
Sep 18$63.14
Sep 19$61.97
Sep 20$61.86
Sep 21$61.39
Sep 22$61.65
Sep 23$62.11
Sep 24$62.22
Sep 25$62.32
Sep 26$61.25
Sep 27$60.97
Sep 28$60.98
Sep 29$60.02
Sep 30$59.29
Oct 1$60.16
Oct 2$60.26
Oct 3$60.47
Oct 4$61.11
Oct 5$60.59
Oct 6$61.22
Oct 7$60.94
Oct 8$60.20
Oct 9$60.24
Oct 10$58.95
Oct 11$58.42
Oct 12$59.16
Oct 13$58.24
Oct 14$59.04
Oct 15$59.22
Oct 16$59.67
Oct 17$58.45
Oct 18$58.69
Oct 19$59.56
Oct 20$59.57
Oct 21$59.49
Oct 22$59.63
Oct 23$59.73
Oct 24$60.66
Oct 25$61.48
Oct 26$60.17
Oct 27$60.76
Oct 28$61.54

Playground Depth

Order book

Depth chart, 32 points from 57.2 to 60.3. Bids from 2,055 to 67, lowest 67, highest 2,055; Asks from 58 to 2,015, lowest 58, highest 2,015.
Order book, data table
priceBidsAsks
57.22,055–
57.31,874–
57.41,698–
57.51,503–
57.61,366–
57.71,202–
57.81,059–
57.9940–
58790–
58.1663–
58.2538–
58.3403–
58.4273–
58.5213–
58.6129–
58.767–
58.8–58
58.9–123
59–238
59.1–313
59.2–404
59.3–513
59.4–650
59.5–738
59.6–895
59.7–1,011
59.8–1,142
59.9–1,308
60–1,483
60.1–1,656
60.2–1,831
60.3–2,015

Installation

Candlestick Chart comes with WunderUI Core and Pro, in the package from your plan. See the plans.

The charts live in their own entry point: import the chart, its card and its hooks from @wunderui/react/charts, not from @wunderui/react.

Then import what you need:

tsx
import {
  CandlestickChart,
  CandlestickChartProps,
  CandlestickChartVariant,
} from "@wunderui/react/charts"

Then use it:

tsx
import { CandlestickChart } from "@wunderui/react/charts"

const data = [
  { date: "Jul 1", open: 42, high: 44.1, low: 41.2, close: 43.5 },
  { date: "Jul 2", open: 43.5, high: 45.3, low: 43, close: 44.8 },
  { date: "Jul 3", open: 44.8, high: 45, low: 42.6, close: 43.1 },
]

export function TokenPrice() {
  return <CandlestickChart data={data} index="date" label="WUI / USD" />
}

Expected result: You see three candles with wicks, green where the close is above the open, and the price axis on the right.

When to use

Use Candlestick Chart for

  • Prices over time with open, high, low and close
  • A price chart with volume or moving averages
  • An order book as a depth chart
  • Renko bricks or Heikin-Ashi candles to filter noise

Use something else for

States

Loading, empty and error keep the chart's size, so the card never jumps. Add a retry handler and the error state offers a Try again button.

WUI / USD

Candlestick chart, 66 points from Aug 24 to Oct 28. Close from $52.79 to $61.54, lowest $52.79, highest $63.35.
WUI / USD, data table
dateClose
Aug 24$52.79
Aug 25$54.12
Aug 26$53.98
Aug 27$53.94
Aug 28$54.57
Aug 29$55.15
Aug 30$55.53
Aug 31$55.36
Sep 1$56.77
Sep 2$58.21
Sep 3$57.70
Sep 4$58.53
Sep 5$57.87
Sep 6$59.39
Sep 7$59.82
Sep 8$59.93
Sep 9$60.51
Sep 10$60.74
Sep 11$61.00
Sep 12$60.16
Sep 13$61.06
Sep 14$61.01
Sep 15$60.73
Sep 16$61.84
Sep 17$63.35
Sep 18$63.14
Sep 19$61.97
Sep 20$61.86
Sep 21$61.39
Sep 22$61.65
Sep 23$62.11
Sep 24$62.22
Sep 25$62.32
Sep 26$61.25
Sep 27$60.97
Sep 28$60.98
Sep 29$60.02
Sep 30$59.29
Oct 1$60.16
Oct 2$60.26
Oct 3$60.47
Oct 4$61.11
Oct 5$60.59
Oct 6$61.22
Oct 7$60.94
Oct 8$60.20
Oct 9$60.24
Oct 10$58.95
Oct 11$58.42
Oct 12$59.16
Oct 13$58.24
Oct 14$59.04
Oct 15$59.22
Oct 16$59.67
Oct 17$58.45
Oct 18$58.69
Oct 19$59.56
Oct 20$59.57
Oct 21$59.49
Oct 22$59.63
Oct 23$59.73
Oct 24$60.66
Oct 25$61.48
Oct 26$60.17
Oct 27$60.76
Oct 28$61.54

Keyboard interactions

The plot is focusable, so the chart works without a pointer.

TaborShiftTab
Moves focus to the plot and away from it. The plot is one tab stop; so is every legend badge.
ArrowRightorArrowLeft
Moves to the next or previous candle. The tooltip follows, and a live region announces the one you are on. The first press starts at the first one (Left: the last one).
HomeorEnd
Jumps to the first or last candle.
ShiftArrowRightorShiftArrowLeft
Extends a selected range from the candle you started on. The range pill and the live region give the move from the first open to the last close with its percentage. Needs .
Escape
Clears the active point and the selected range.
EnterorSpace
On a legend badge of a ChartCard: switches its series off or on. The last visible series stays on.

Behavior and motion

What the chart does on its own and what the page decides.

Field names
Each row supplies open, high, low, close and volume. Other field names can be mapped, a row with a missing price is skipped, not drawn as zero, and numbers follow the reader's locale unless a locale or a formatter is set.
Up and down
A candle is green when the close is above the open and red below. Hollow candles outline the rising ones and fill the falling ones, so direction survives without colour.
Price axis
The price axis sits on the right and fits the data, with no zero baseline. Volume bars take the bottom fifth, and only the depth chart starts at 0.
Overlays
Moving averages default to windows of 7 and 21, and Renko takes a brick size. The depth chart plots cumulative bids left of the spread and asks right.
Narrow charts
When a candle would get thinner than 4 px, neighbouring candles are bundled into one: the first open, the highest high, the lowest low and the last close, with the volume summed. The tooltip names the bundled rows, and full resolution keeps every candle.
Loading, empty and error
The chart keeps its size while loading, empty or failed, so the card never jumps. Add a retry handler to show a Try again button on error.
Legend
A ChartCard shows the series as badges. With two or more, each badge switches its series off and the last visible one stays on, and a legend of roles can be made static.
Size
The chart fills the width of its container, and you set the plot height. Text never scales, so labels keep their size at every width.

Motion

The enter sequence and the hover follow the library motion tokens.

Enter
Candles and OHLC bars open from their middle, left to right, volume bars grow from the bottom, and moving averages and the depth chart wipe in. It plays when the chart first comes into view, after loading and when the data changes.
Hover
The active candle keeps its strength and the others dim, while the tooltip shows open, high, low and close.
Reduced motion
With reduced motion the chart appears at once. The tooltip, crosshair and every state still work.

Anatomy

The trading chart family: candles, OHLC bars, volume, moving averages, Heikin-Ashi, Renko bricks and an order-book depth chart. The price axis sits on the right, up is green and down is red.

WUI / USD

Candlestick chart, 8 points from Jul 1 to Jul 8. Close from $43.50 to $45.50, lowest $43.10, highest $46.00; Volume from $24000.00 to $27000.00, lowest $22000.00, highest $41000.00.
WUI / USD, data table
dateCloseVolume
Jul 1$43.50$24000.00
Jul 2$44.80$31000.00
Jul 3$43.10$28000.00
Jul 4$43.90$22000.00
Jul 5$45.90$41000.00
Jul 6$46.00$36000.00
Jul 7$44.60$30000.00
Jul 8$45.50$27000.00
  • Takes data and an index field, and reads open, high, low, close and volume by those names. Moving averages, the Renko brick size and the order-book fields are set by props.

  • data-slot="chart-plot"

    The focusable region: arrow keys walk the candles, and Shift with an arrow selects a range. A pill and a live region report the move from the first open to the last close.

  • data-slot="chart-grid"

    The price axis sits on the right without a zero baseline, except in the depth chart. With volume the bars take the bottom fifth, and the depth chart plots bids left of the spread and asks right.

  • data-slot="chart-marks"

    A body from open to close with a wick from low to high, or an OHLC bar. Green is up and red is down, and hollow candles keep the direction readable without colour.

  • Optional

    Moving average lines (orange, then purple) and grey volume bars, each in its own chart type.

  • data-slot="chart-tooltip"Optional

    The date with open, high, low and close, plus volume when it is shown.

  • data-slot="chart-message"Optional

    A skeleton, empty and error messages, as on the other charts. A row with a missing price is skipped, not drawn as zero.

  • Open, high, low, close and volume per period as a table for screen readers.

Best practices

  • Do

    Pass a value formatter with the currency and the right decimals, like $1,842.50. The default shows up to two decimals and no currency symbol.

  • Do

    Add the volume bars rather than a second chart when volume explains the move. They share the time axis, so a spike lines up with its candle.

  • Do

    Select a range with Shift and the arrows to read the price change over it. Keyboard users get the same figure as a mouse drag.

  • Don’t

    Don't rely on green and red alone. Use hollow candles or OHLC bars for print and red-green colour blindness, and keep the tooltip for exact values.

  • Don’t

    Don't show Renko or Heikin-Ashi as the plain price. They are transformed series, so name the variant in the card title.

API reference

One table for CandlestickChart, listing every prop. The ChartCard around it takes its own props, and the chart works without one.

Takes data and an index field, and reads open, high, low, close and volume by those names. Moving averages, the Renko brick size and the order-book fields are set by props.

PropTypeDefaultDescription
data requiredreadonly ChartDatum[]—One object per category / point.
index requiredstring—Field holding the category label (x axis; y axis for horizontal bars).
variant"candles" | "hollow-candles" | "ohlc" | "candles-volume" | "candles-moving-average" | "heikin-ashi" | "depth-chart" | "renko""candles"Figma variant. Default .
openstring"open"Fields of the OHLC rows. Defaults: open, high, low, close, volume.
highstring"high"
lowstring"low"
closestring"close"
volumestring"volume"
movingAveragesreadonly number[]DEFAULT_MOVING_AVERAGES: window lengths of the moving averages. Default [7, 21].
rangeSelectableboolean—Allow selecting a range by dragging or Shift + arrow keys. On when is set.
valueFormatterChartValueFormatter—Values in tooltip, labels, table and live region. Default: 42000 → "42k".
labelstring—Accessible name, e.g. the card title.
heightnumber—Fixed height of the plot frame in px. Without it the height follows the width (, , ): 220 px on a phone, up to 434 px (the plot of the Figma large card) from about 1130 px wide.
state"ready" | "loading" | "empty" | "error"— shows the chart-shaped skeleton, and a message in the plot.
activeIndexnumber | null—The active point (hovered or focused) as an index into , to control it yourself. shows none.
animateboolean—Enter sequence (draw, wipe, grow) on scroll into view, after loading and on new data. Default true; off with reduced motion.
animationKeystring | number—Change it to play the enter sequence again (e.g. ). New replays it by itself.
askstring"ask"
aspectRationumber—Width ÷ height when is not set. Default 2.6.
axisFormatterChartValueFormatter—Value-axis labels; defaults to .
bidstring"bid": fields of the order book rows (price = ). Defaults: bid, ask.
brickSizenumber—: price move per brick (default: a twelfth of the price range, rounded).
categoryAxisboolean—Category-axis labels (default true).
categoryFormatter(label) => string—Shortens category labels on the axis, e.g. "Mar 12" → "Mar"; tooltip and pill keep the full label.
categoryTicksreadonly string[]—Only these category labels are shown on the axis (the rest stay hoverable).
defaultActiveIndexnumber | null—The point that is active at first, for an uncontrolled chart. It shows the tooltip without a pointer.
defaultSelectedRangeChartRange | null—The range that is selected at first, for an uncontrolled chart.
descriptionstring—Screen-reader summary; generated from the data when omitted.
emptyDescriptionstring—Text under the title in the empty state.
emptyTitlestring—Title of the message in the empty state.
errorDescriptionstring—Text under the title in the error state.
errorTitlestring—Title of the message in the error state.
gridboolean—Grid lines (default true).
gridFadeboolean—The grid fades out towards both ends (default true).
gridIntervalsnumber—Number of equal grid intervals. Default: one per 44 px of plot height, capped by the size class (xs 2, sm 3, md 3, lg 4, xl 5).
gridStyle"solid" | "dashed"—Grid lines are dashed 4 / 4 by default; draws them through.
hiddenSeriesreadonly string[]—Series keys that are switched off (legend toggle): drawn faded, dimmed in the tooltip.
includeZeroboolean—The value axis starts at 0 (owner rule, default). fits the data (prices, temperatures).
localestring—Locale of the default number formats for prices, depth and volume, such as en-US. Without it the numbers follow the reader's locale, and a value formatter replaces the price format.
maxHeightnumber—Highest height from . Default 434.
minHeightnumber—Lowest height from . Default 220.
onActiveIndexChange(index) => void—Called with the index when the pointer or the arrow keys move to another point, and with when they leave. Use it to show the hovered value in a headline.
onRetry() => void—Shows a Try again button in the error state and calls this when it is pressed.
onSelectedRangeChange(range) => void—Called when a drag across the plot or Shift with an arrow key changes the range, and with when Escape or a click clears it.
resolution"auto" | "full"— (default): lines and areas draw at most 1.5 points per pixel (LTTB; hover and tooltip keep every point), and bars on a time axis that would get thinner than they may are gathered into weeks, months … draws every point and eve…
selectedRangeChartRange | null—The selected range as inclusive indices into , to control it yourself. selects nothing.
tooltipboolean—Tooltip on hover / keyboard focus. Default true.
tooltipTitle(datum, index) => ReactNode—Title line of the tooltip; defaults to the category label.
valueAxisboolean—Value-axis labels (default true). Off for compact cards and sparkline-like plots.
valueAxisPlacement"auto" | "outside" | "inside"—Where the value labels go: left of the plot, in the plot above their grid lines (saves the label column on narrow charts). (default) puts them left of the plot at every size; is opt-in.
valueAxisSide"left" | "right"—Side of the value axis (vertical charts). is the price axis of trading charts.
valueDomainreadonly [number, number]—Fix the value domain instead of fitting it to the data (still rounded to nice steps).
valueTicksreadonly number[]—Exact value-axis ticks (ascending), e.g. [0, 10000, … 70000]; replaces the nice-step domain.
widthnumber—Fixed width instead of filling and measuring the container.
xScale"band" | "time"— (default): the categories sit side by side in equal bands. : the field holds dates (Date, ms or a string such as "2026-03-01"); points sit at their real distance, the axis picks its tick level (hours → days → weeks → m…

Notes for AI

Give your coding assistant the Markdown reference instead of screenshots.

MCPget_component("candlestick-chart")
InstallIncluded in Core and Pro

The full library index for assistants is at /llms.txt.