Prices over time as candles, like a trading chart: open, high, low and close per period, with volume. Plain SVG.
$ pnpm dlx shadcn@latest add https://dashral.com/r/candlestick-chart.jsonInstallation
$ pnpm dlx shadcn@latest add https://dashral.com/r/candlestick-chart.jsonAdds the component, the components it builds on, its npm packages and the theme tokens it uses. Using Dashral often? Add the registry to components.json once:
{
"registries": {
"@dashral": "https://dashral.com/r/{name}.json"
}
}Then add components by name:
$ pnpm dlx shadcn@latest add @dashral/candlestick-chartUsage
import { CandlestickChart } from "@/components/dashral/candlestick-chart"
<CandlestickChart
data={[
{ time: "2026-10-20", open: 182.4, high: 186.1, low: 181.2, close: 185.3, volume: 51200 },
{ time: "2026-10-21", open: 185.3, high: 187.9, low: 183.6, close: 184.1, volume: 48900 },
{ time: "2026-10-22", open: 184.1, high: 189.2, low: 183.8, close: 188.7, volume: 62300 },
]}
formatOptions={{ style: "currency", currency: "USD" }}
aria-label="ACME, daily"
/>Examples
API reference
CandlestickChart
Also takes every prop of <div>(opens in a new tab).
| Prop | Type | Default |
|---|---|---|
data | { time, open, high, low, close, volume? }[]The periods, oldest first; time is a timestamp in ms or an ISO date. Required. | — |
height | numberIn pixels, axes included; the width follows the container. | 320 |
showVolume | booleanVolume bars under the candles. | when the data has volume |
showLastPrice | booleanA dashed line at the last close, with its price on the axis. | true |
formatOptions | Intl.NumberFormatOptionsHow prices are written, e.g. { style: "currency", currency: "USD" }. | two decimals |
timeFormat | Intl.DateTimeFormatOptionsHow dates are written under the chart and in the header. | { month: "short", day: "numeric" } |
locale | string | the LocaleProvider's |
aria-label | stringWhat the chart shows, e.g. “BTC/USD, daily”. | "Trend from … to …" |
classNames | { up, down, header }up and down are text colors for rising and falling candles (text-success, text-destructive). | — |
Keyboard
| Keys | Action |
|---|---|
| Tab | Focus the chart |
| ←or→ | Read the previous or next period |
| HomeorEnd | The first or last period |
| Esc | Back to the latest period |
Accessibility
- A group named by your label; the period you move to with the arrow keys is read out (date, open, high, low, close).
- Time runs left to right in every language, as on any trading chart; the header follows the page's direction.
Motion
- The candles are revealed left to right when the chart first shows; instant with reduced motion. Live updates move the last candle in place.