Price chart

A React component in Beamline's Trading category.

Candles, line or area price chart with volume, OHLC legend and reference lines, built for live ticks.

Use it for

  • The main price view of a market: candles for traders, line/area for a simpler asset page.
  • Anything that updates several times a second — canvas keeps it cheap.

Not for

Anatomy

  • root (a size container and one keyboard stop)
  • canvas (price pane, volume histogram)
  • legend (symbol, O H L C, change, volume; the keyboard candle's time)
  • price lines
  • right price axis
  • time axis

Variants

  • type: candles, line, area
  • volume: on, off

States

  • loading-initial (no candles: faint baseline, spinner and "Loading BTC-USD…", elapsed seconds after 2s)
  • live
  • updating (candles kept; "Updating…" chip at the top end of the plot, never a veil)
  • stale (caller's words in a chip with a clock glyph, e.g. "Stale · 12s")
  • error (caller's words in a chip with an alert glyph; last candles kept)
  • empty ("No price data")
  • hover (legend follows the crosshair; crosshair labels on the tooltip colours)
  • keyboard reading (← → walk the candles on the engine's own crosshair; the legend names the candle's time; screen readers hear its OHLC)
  • room: the legend keeps the close and change; high and low fold under 24rem, open and volume under 34rem; the volume pane hides under a 360px plot; any height when height="fill"

Keyboard

  • Tab focuses the plot (one stop)
  • ← / → move the crosshair one candle (Shift: ten); the first press starts at an end of the visible range
  • Home / End jump to the first / last candle, bringing the range along
  • Escape lets go of the candle; leaving the plot does too
  • Products add interval and type controls as real buttons.

Motion

Live ticks replace the last candle in place and never travel. Another series type fades in over the old drawing (the fade-out duration, kept under reduced motion). The keyboard's crosshair moves at once. Colours re-resolve instantly on theme or accent change.

Props

PropTypeDefaultDescription
candles (required)Candle[]—OHLC candles in ascending time order; missing volume stays unmeasured. Required.
type"candles" | "line" | "area"candlesRendering mode for the component. Defaults to "candles".
ticknumber0.01Price increment of the market; sets the axis and legend precision.
volumebooleantrueVolume histogram under the price.
priceLines{ price, label, tone?, dashed? }[]—Horizontal reference lines: entry, liquidation, open orders, alerts.
legendbooleantrueOHLC legend in the top-left, following the crosshair.
symbolstring—Market symbol printed in the chart legend; omitted by default to show no symbol label.
heightnumber | "fill"360Plot height in pixels, or fill to use the available room; defaults to 360.
onCrosshairMove(candle: Candle | null) => void—Called with the candle under the crosshair, or null when it leaves.
loadingboolean—Shows the loading state while data or an operation is pending. Defaults to false.
errorReactNode—Caller-owned feed error; existing candles remain visible.
staleReactNode—Caller-owned stale description, e.g. Stale · 12s.
classNamestring—Classes on the documented visual root; no override by default.
styleCSSProperties—Inline styles on the documented visual root; no inline overrides by default.
classNamesPartial<Record<"root" | "legend" | "loading" | "empty" | "status" | "canvas", string>>—Classes for the named visual parts; no part overrides by default.
refRef<HTMLDivElement>—Receives the documented root element; no ref by default.

Built from

Used in

Dependencies

lightweight-charts

Import

import { PriceChart } from "@beamline/price-chart";

Get it

Price chart is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent

More in Trading

  • Market heatmap: Treemap of markets sized by weight and coloured by change, grouped by sector, with hatched no-data tiles.
  • Order book: Asks, spread and bids with cumulative depth bars, grouping, change flashes and keyboard price picking.
  • Options chain: Calls and puts for one expiry around a centre column of strikes: bid, ask, implied volatility, delta, volume and open interest, the money shaded in, a…
  • Depth chart: Cumulative bid and ask depth as stepped areas around the mid, with hover readout.
  • Ticker tape: A continuously scrolling row of symbols with price, change and mini trend; anyone can hold it: hover, keyboard focus or a tap.
  • Watchlist: A selectable, sortable list of markets with mini trends, prices, changes and stars.
  • Trades tape: Recent trades, newest first, with side glyphs, large-print marking and one-time arrival flashes.
  • Order ticket: Buy/sell order entry with limit, market and stop types, % of balance, inline validation and a live cost summary.
  • Swap form: Exchange one token for another: type what you pay (or Max), pick each token from a searchable list with balances, and the form quotes what you receive…
  • Positions table: Open positions with live unrealised PnL, liquidation warnings and close actions.
  • P&L calendar: A trader's month at a glance: every trading day's profit or loss in its cell, shaded deeper the bigger it was in the gain or loss colour and marked ▲ or…
  • Price ticker: Symbol, last price with a directional flash, 24h change and stats.
  • Funding countdown: Perpetual funding rate with who pays, and a live countdown ring to the next funding.

Guides: Connect a React app to your backend with Beamline UI · Build a trading terminal in React

Part of Beamline UI: polished, editable React components and complete screens for custom applications. Build your own style from any look; tokens, fonts, radii, motion; not only colours.