Trading terminal
A React block (a whole screen) in Beamline's Trading app.
A perpetuals terminal on your feed and your account: ticker tape, market header with funding, candles, book / trades / depth, order ticket, account figures, positions and open orders. The terminal renders and calls the account; it never fills an order itself.
Use it for
- The main screen of an exchange, broker or trading tool: pass your symbols, a `useFeed` hook around your market stream (`MarketFeed`) and an `account` on your order API (`TradingAccount`), both from @beamline/ui/lib/market. It arranges itself by its own width, from a four-column desk down to a phone column.
Not for
- A portfolio overview without order entry (compose watchlist, positions-table and metric-card instead).
Anatomy
- ticker tape
- market header (market picker below 1400px, price ticker, 24h figures, funding)
- watchlist (≥ 1400px)
- chart with timeframe and chart type (entry, liquidation and order lines; plot stays LTR)
- book / trades / depth
- order ticket
- account figures
- positions / open orders tabs
- phone: Book · Trades · Positions · Orders tabs, a sticky Buy / Sell bar and the ticket in a bottom sheet
- toasts
Variants
- layout (by the terminal's own width): wide ≥ 1400: watchlist · chart · book · ticket, positions under all but the watchlist, three 1024–1399: chart · book · ticket, watchlist in the Markets picker, two 640–1023: main column (header, chart 320, positions) and a 300px side (ticket, account, book), one < 640: one scrolling column (header in two rows, chart, tabs, account) above a Buy / Sell bar in the terminal's last row, so no row ever scrolls beneath it, short (< 800px tall, wide/three): ticket column full height, positions under chart and book
States
- no positions
- positions open
- orders resting
- order rejected (the account's message in the ticket; the phone sheet stays open)
- close or cancel failed (toast)
- fill announced (resting order reached)
- market switched
- live feed: unchanged view controls, funding inputs and account figures do not render on each market tick; their own state and scope changes still update
- phone ticket open (bottom sheet; closes when the account accepts the order)
Keyboard
- every part keeps its own keyboard model: watchlist and book rows are roving lists (↑/↓, Enter)
- tabs ←/→
- Tab order follows the reading order: header, markets, chart, book, ticket, positions
- phone: Buy / Sell open the ticket in a sheet with that side chosen; Escape or Close returns focus to the pressed button
Motion
No layout motion; the arrangement switches by width without animating. Prices flash per the price-ticker and order-book rules; the phone sheet slides in from the bottom (instant under reduced motion); toasts follow the toast stack and rise above the phone Buy / Sell bar. An order that changes the account sends a consequence trace (ui/lib/trace.ts) from the ticket to every figure it changed (the position's row, margin used, free margin, buying power); the figures change at once, the light only shows where. Reduced motion: each changed figure holds a ring instead.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
symbols | Ticker[] | — | Markets offered in the watchlist and tape. |
useFeed | UseMarketFeed | — | Streams the open market (candles, book, trades, last price). Called once per market; switching symbol or timeframe remounts it. `useMockFeed` from demo/market-simulator drives the demos (simulated, never a real market). |
account | TradingAccount | — | Balance, positions and resting orders, and the calls that change them. `usePaperAccount` from demo/paper-account drives the demos (a simulation, never a real account). |
leverage | number | — | Leverage the account trades at: sizes the ticket's buying power and the margin figures. |
defaultSymbol | string | — | Initial market symbol; defaults to the first supplied symbol, then BTC-USD. |
className | string | — | Classes on the documented visual root; no override by default. |
classNames | TradingTerminalClassNames | — | Classes for the named visual parts; no part overrides by default. |
style / ref | CSSProperties / Ref<HTMLDivElement> | — | style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the documented root element; no ref by default. |
symbol / defaultSymbol / onSymbolChange | string | — | symbol: Controlled market symbol; omitted by default to keep the chosen market locally. defaultSymbol: Initial market symbol; defaults to the first supplied symbol, then BTC-USD. onSymbolChange: Reports the market chosen from the tape, watchlist or market picker; no callback by default. |
style | CSSProperties | — | Inline styles on the documented visual root; no inline overrides by default. |
symbol | string | — | Controlled market symbol; omitted by default to keep the chosen market locally. |
onSymbolChange | ((symbol: string) => void) | — | Reports the market chosen from the tape, watchlist or market picker; no callback by default. |
ref | Ref<HTMLDivElement> | — | Receives the documented root element; no ref by default. |
Built from
- ticker-tape
- price-ticker
- funding-countdown
- segmented-control
- watchlist
- price-chart
- tabs
- order-book
- trades-tape
- depth-chart
- order-ticket
- positions-table
- table
- button
- toast
- sheet
- popover
- empty-state
Dependencies
lightweight-charts, d3-scale, d3-shape, lucide-react, motion
Import
import { TradingTerminal } from "@beamline/trading-terminal";
Get it
Trading terminal 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 screener: The whole market at a glance and a way to narrow it down: a sector heatmap, today's top movers with the market's breadth, ready-made screens (gainers…
- Portfolio overview: What an account holds and how it is doing: the total that rolls as prices tick with today's change, value over time against a benchmark, allocation by…