Candlestick Chart
OHLC candles printing left to right with a moving average. Install with npx remotion-ui@latest add candlestick-chart.
PrimitiveData & mediaAdvanced
$ npx remotion-ui@latest add candlestick-chartA price tape: open-high-low-close candles printing in order, with an optional moving average running behind them.
import { CandlestickChart } from "@/remotion/primitives/candlestick-chart";
<CandlestickChart
candles={[{ open: 101, high: 106, low: 99, close: 104, label: "W1" }]}
movingAverage={6}
staggerInFrames={3.4}
/>Candles grow from their open
Each candle grows out of its own open price in both directions, not up from the axis. The open is where the period started, so it is the only anchor that leaves a half-drawn candle telling the truth. The wick runs slightly ahead of the body, which is how a real tape prints — the extremes are known before the period closes.
A doji, where open equals close, still gets a minimum body height rather than disappearing.
The average
movingAverage is a simple mean over that many closes, plotted only where a
full window exists — a partial window would draw an average of fewer candles
than the legend claims. The line trails the candles by a few frames instead of
drawing after all of them, so it reads as a running calculation over what is
already on screen.
Scale
The value axis is taken from the highs and lows and is not anchored at zero:
price charts are read for range, and a zero baseline would flatten a day's
movement into a hairline. showLastPrice pins the final close against the right
edge in the colour of its own candle.
Candles grow out of their own open in both directions, so a half-drawn candle still tells the truth; the wick runs a little ahead of the body, as a real tape prints. The average is plotted only where a full window exists. The axis is not anchored at zero — price is read for range, and a zero baseline flattens the movement.
Agent notes
Install first, then import the copied source component locally. AI guide →
@/remotion/primitives/candlestick-chart- Use when: data stories, metrics, charts, and numeric proof points.
- Customize: candles, width, height, upColor, plus copied source for timing, layout, colors, and typography.
- Rule: do not import this component from the
remotion-uinpm package; it is copied into your project.
Usage
import { CandlestickChart } from "@/remotion/primitives/candlestick-chart";
<CandlestickChart
candles={[{ open: 101, high: 106, low: 99, close: 104, label: "W1" }]}
movingAverage={6}
staggerInFrames={3.4}
/>API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| candles | Candle[] | required | `{ open, high, low, close, label? }`, oldest first. |
| width | number | 900 | Drawing width. Type scales off it. |
| height | number | 460 | Drawing height. |
| upColor | string | "#2dd4bf" | Candles that closed at or above their open. |
| downColor | string | "#f472b6" | Candles that closed below their open. |
| movingAverage | number | 7 | Window for the simple moving average. 0 hides the line. |
| showLastPrice | boolean | true | Final close pinned against the right edge. |
| showAxis | boolean | true | Gridlines and price labels down the left gutter. |
| durationInFrames | number | 12 | Length of one candle's growth. |
| staggerInFrames | number | 3 | Frames between one candle and the next. |
| exitAtInFrames | number | undefined | Frame the tape clears on, oldest first. |
| frame | number | undefined | Frame override — pass the parent frame inside a `<Sequence>`. |