Order ticket

A React component in Beamline's Trading category.

Buy/sell order entry with limit, market and stop types, % of balance, inline validation and a live cost summary.

Use it for

  • Placing an order on a market.
  • A docked column (240–360px) or a wide tile, where the review and action stand beside the entry.

Not for

  • Swaps with routing and slippage → build a swap form on the same fields.

Anatomy

  • side switch (Buy/Sell radiogroup, full-bleed header across the ticket's top edge; the ticket clips to its frame's corners; the chosen side is a solid in its market colour, a divider below)
  • entry (type tabs, balance, fields, shares, options) and review (summary, submit, result): stacked in a column; from 36rem the review stands beside the entry, settled to its foot
  • type tabs (underline)
  • available balance
  • trigger field (stop)
  • price field with Last shortcut
  • market estimate well (market)
  • size field
  • share-of-balance keys (held key sits pressed in)
  • post-only / reduce-only (Checkbox)
  • summary (value, fee, total)
  • submit (Button lg, data-slot="button", filled with the side's colour)
  • result line (icon + words)

Variants

  • types: limit, market, stop

States

  • empty
  • invalid (red boundary through the field's role inputs, icon + words under the field; the error grows out of its field)
  • ready
  • submitting (Button loading: spinner in front, width and focus kept)
  • accepted (✓ icon + the exchange's result; focus moves to Size)
  • rejected (! icon + the exchange's words; draft kept)
  • disabled submit (--pui-opacity-disabled, same in every look)
  • No submission handler: show a rejection message and preserve the draft; never report placement or a fill without a caller acknowledgment.
  • share picked (the size and every figure of the review change at once; a trace light runs from the key to each)
  • stop chosen (the trigger field grows in); market chosen (the estimate fades in where the price field stood)

Keyboard

  • Native form: Tab order follows the layout, Enter submits
  • Side is a radiogroup and type a tablist, each one tab stop: arrow keys (mirrored in RTL), Home and End change the choice and move focus with it
  • ↑/↓ in Trigger, Price and Size step the figure by the tick or size step, on its grid (Shift: ten steps); typing is never animated

Motion

The chosen side's solid is one slab that travels between Buy and Sell as matter (ui/lib/contour.ts) and changes colour with the side; the label takes the ink that reads on the slab once the slab is under it. The order type's underline travels to the type chosen. Hover arrives at 0ms and leaves over --pui-motion-out; the submit presses like Button. A share of the balance sends a trace (ui/lib/trace.ts) to the size and each review figure; errors and the stop trigger grow to their height (.enter-grow) so what sits below glides; a result fades in as itself. Reduced motion: the trace becomes a held ring on each figure; grows place at once.

Props

PropTypeDefaultDescription
base / quote (required)string—base: Base asset label used with trade sizes. Required. quote: Quote currency shown with prices or totals. Required.
last (required)number | null—Last traded price: used for market orders and the "Last" shortcut.
available (required){ quote, base }—Free balance: quote currency for buys, base for sells.
tick / sizeStep / feenumber—tick: Smallest permitted price increment. Defaults to 0.01. sizeStep: Smallest permitted order-size increment. Defaults to 0.0001. fee: Taker/maker fee as a fraction.
side / defaultSide / onSideChange'buy'|'sell'—side: Controlled buy or sell side; omit to use defaultSide. defaultSide: Initial order side when uncontrolled. Defaults to "buy". onSideChange: Reports order side after a change; no callback by default.
price / onPriceChangestring—price: Controlled limit price as decimal-point text (for example "1234.50"); the field displays it in the root locale. onPriceChange: Reports order price after a change; no callback by default.
onSubmit(order) => void | Promise<void>—Resolve to confirm, throw an Error to show its message. The button shows loading meanwhile.
labelsPartial<OrderTicketLabels>—Rename any of the ticket's words; the rest keep their defaults (ORDER_TICKET_LABELS).
classNamestyped part classes—Classes for the named visual parts; no part overrides by default.
styleCSSProperties—Inline styles on the documented visual root; no inline overrides by default.
refHTMLFormElement—Receives the documented root element; no ref by default.
defaultPricestring—Initial price text when uncontrolled; defaults to last formatted to tick precision, or empty if last is unknown.
base (required)string—Base asset label used with trade sizes. Required.
quote (required)string—Quote currency shown with prices or totals. Required.
ticknumber—Smallest permitted price increment. Defaults to 0.01.
sizeStepnumber—Smallest permitted order-size increment. Defaults to 0.0001.
feenumber—Taker/maker fee as a fraction.
sideSide—Controlled buy or sell side; omit to use defaultSide.
defaultSideSide—Initial order side when uncontrolled. Defaults to "buy".
onSideChange((side: Side) => void)—Reports order side after a change; no callback by default.
pricestring—Controlled limit price as decimal-point text (for example "1234.50"); the field displays it in the root locale.
onPriceChange((price: string) => void)—Reports order price after a change; no callback by default.
typesOrderType[]—Order types offered in the tabs; defaults to limit, market and stop in that order.
classNamestring—Classes on the documented visual root; no override by default.

Built from

Used in

Import

import { OrderTicket, ORDER_TICKET_LABELS } from "@beamline/order-ticket";

Get it

Order ticket 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

  • Price chart: Candles, line or area price chart with volume, OHLC legend and reference lines, built for live ticks.
  • 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.
  • 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: 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.