Order history and fills
A React block (a whole screen) in Beamline's Shop app.
Every order the account placed and every fill it got, for a period: totals for volume, fees, fill rate and maker share; orders with their status and how much filled; each fill with its price, fee and maker or taker; an order opens with its fills and what happened when; and the view exports as CSV.
Use it for
- The history page of a trading or brokerage account: what was ordered, what filled at what price, and what it cost in fees.
- Reconciling fills and fees for a period and exporting them.
Not for
- Orders still resting on a market screen (trading-terminal's open orders).
- The tape of a market's public trades (trades-tape).
- Holdings and their value (portfolio).
Anatomy
- header: title, the period (date range with presets), Orders / Fills, and the primary Export CSV
- totals: volume traded, fees paid, fill rate and maker share for the period and filters in view
- filters: side and status as chips with counts; the table's own search and market filter
- orders: time, market, side (word and glyph), type, status, price (Market for market orders), filled of size with a bar, average fill price (a quiet dash before any fill), fees
- fills: time, market, side, price, size, value, fee, maker or taker, and the order it belongs to
- order sheet: status and side, filled of size, average price against the limit, fees by fill, the fills, and the order's events in time order
Variants
- 0: room: totals four across from 48rem, two by two under it; the sheet is full width on a phone
States
- loading (totals and table held in their shapes)
- nothing in the period (says so and offers a longer period)
- nothing matches the filters (clear them)
- partly filled, cancelled with part filled, rejected (the reason), expired, open
- fee unknown (—, totals say how many are missing)
- exporting / exported (row count) / export failed (Retry)
Keyboard
- Tab: header controls, filter chips, the table
- Table: arrows move between cells, Enter opens the order
- Sheet: Esc closes and focus returns to the row
Motion
Totals roll to their new values when the period or a filter changes; the export button morphs through exporting and done; the sheet slides in on --motion-in. Nothing moves at rest.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
orders (required) | HistoryOrder[] | — | Orders supplied by the trading account. Required. |
range / defaultRange / onRangeChange | { start: Date; end: Date } | — | range: Controlled reporting range; omit to use defaultRange. defaultRange: Initial date filter; omitted by default to include all supplied orders and fills. onRangeChange: Reports date range after a change; no callback by default. |
view / defaultView / onViewChange | "orders" | "fills" | — | view: Controlled display mode; omit to use defaultView. defaultView: Initial view when uncontrolled. Defaults to "orders". onViewChange: Reports view after a change; no callback by default. |
loading | boolean | — | Shows the loading state while data or an operation is pending. Defaults to false. |
quote | string | "USD" | Currency of prices, value and fees. Default USD. |
onExport | (rows: { view, ids: string[] }) => Promise<number> | number | — | Export what is in view; resolve with the number of rows written. |
className / classNames / style / ref | string / OrderHistoryClassNames / CSSProperties / Ref<HTMLElement> | — | className: Classes on the documented visual root; no override by default. classNames: Classes for the named visual parts; no part overrides by default. style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the documented root element; no ref by default. |
range | DateRange | — | Controlled reporting range; omit to use defaultRange. |
defaultRange | DateRange | — | Initial date filter; omitted by default to include all supplied orders and fills. |
onRangeChange | ((range: DateRange) => void) | — | Reports date range after a change; no callback by default. |
view | OrderHistoryView | — | Controlled display mode; omit to use defaultView. |
defaultView | OrderHistoryView | — | Initial view when uncontrolled. Defaults to "orders". |
onViewChange | ((view: OrderHistoryView) => void) | — | Reports view after a change; no callback by default. |
title | string | — | Heading shown above the content. Defaults to "Orders and fills". |
className | string | — | Classes on the documented visual root; no override by default. |
classNames | Partial<Record<"root" | "header" | "table" | "sheet" | "filters" | "export" | "totals",… | — | Classes for the named visual parts; no part overrides by default. |
style | CSSProperties | — | Inline styles on the documented visual root; no inline overrides by default. |
ref | Ref<HTMLElement> | — | Receives the documented root element; no ref by default. |
fills | HistoryFillRow[] | — | In manual fills view, the server page of fills with each parent order. Omit in local mode to derive fills from orders. |
manual | boolean | — | Server owns ordering, filters, search and page slicing. Default false. |
sort | ListSort | — | |
defaultSort | ListSort | — | |
onSortChange | ((sort: ListSort) => void) | — | |
filters | ListFilters | — | |
defaultFilters | ListFilters | — | |
onFiltersChange | ((filters: ListFilters) => void) | — | |
query | string | — | |
defaultQuery | string | — | |
onQueryChange | ((query: string) => void) | — | |
selected | string[] | — | Stable row IDs, retained across server pages. |
defaultSelected | string[] | — | |
onSelectedChange | ((ids: string[]) => void) | — | |
selectable | boolean | — | |
error | ReactNode | Error | — | Errors retain the last completed rows. Error objects are rendered by their message. |
onRetry | (() => void | Promise<unknown>) | — | |
emptyLabel | string | — | |
allowSelectAllMatching | boolean | — | |
onSelectAllMatching | ((scope: { rowCount: number; query: string; filters: ListFilters; }) => void) | — | |
pagination | boolean | — | Enable page controls explicitly. Page-related props also enable them, unless onEndReached is supplied. |
page | number | — | One-based requested page. Default 1. |
defaultPage | number | — | |
onPageChange | ((page: number) => void) | — | |
pageSize | number | — | Positive rows per page. Default 25. |
defaultPageSize | number | — | |
onPageSizeChange | ((pageSize: number) => void) | — | |
rowCount | number | null | — | Total matching rows on the server. null means unknown. Local grids calculate it before slicing. |
total | number | null | — | Deprecated: Use rowCount. Canonical rowCount wins, including null. |
onEndReached | (() => void | Promise<unknown>) | — | Append mode: fetch another batch. The app appends it to the supplied rows. |
hasMore | boolean | — | Whether another batch exists; defaults to true with onEndReached. False stops requests. |
loadingMore | boolean | — | An append request is pending; retain every loaded row. |
Built from
- metric-card
- date-range-picker
- segmented-control
- chip-group
- data-grid
- badge
- progress
- sheet
- table
- timeline
- button
- empty-state
- slot-text
Dependencies
lucide-react, @tanstack/react-virtual
Import
import { OrderHistory } from "@beamline/order-history";
Get it
Order history and fills 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 Shop
- Product editor: A product being made in a shop's back office, every value read as text at rest. The variant grid, grouped by the first option, lists each combination…
- Category manager: A shop's product categories, nested and ranked. Each category moves up, down or into another from its menu, and every move gets its own receipt (saving…
- Inventory item: One stock item in a shop's back office, apart from the variants that sell it (how many each uses per unit). Stock per location as stocked, reserved and…
- Plan comparison: Plans side by side against every feature: prices that roll between monthly and yearly, the current and recommended plan marked, a header that stays in…
- Step form: The finished frame for any multi-step form you compose — onboarding, intake brief, questionnaire, booking, application: a wide card with progress, the…
- Orders admin: A shop's order desk: today's orders and revenue, quick filters for what needs doing (to fulfil, unpaid, returns), a virtualised orders grid, and the…
- Order detail: One shop order with payment and fulfilment as two separate lanes. The header says where each stands (paid, partly paid, awaiting, refunded; not…
- Order board: A shop's orders as cards in its columns, on the shared kanban with drag and keyboard moves. Each card: number, estimate or work order, customer, vehicle…
- Order composer: An order made inside a support ticket: products found by name, each variant with its stock drawn and said (in stock, none, oversold, not known) and the…
- Draft orders: A draft order made for a customer in a shop's back office that reads like the order it will become. The lines lead: each with its variant and SKU or…
- Order changes: What happens to a shop order after it's placed. Edit: the order as it stands beside the requested version, each line marked new, changed (old → new…
- Special orders: Customers' special orders as demand to buy for, per outlet: To order apart from Ordered; each product's demand, what is reserved, incoming and on order…
- Order ledger: Purchase orders as money. Each order's spend is drawn against its approved total (paid, billed, pending, what is left, and any overrun past the end…
- Ticket orders: A customer's orders inside a support ticket, each action's effect said before it's done: orders and drafts kept apart, a paid draft shown once as its…
- Record search: One search across connected records (customers, vehicles, orders) by name, phone, plate, VIN or order number. What the words look like is said (info)…
- Return queue: A queue of return cases. Search by return, order or customer, exactly (the default) or loosely; status tabs with counts, Requires attention first; a date…
- Return case: One return as one place where every act is its own. The return, its order (linked out) and the customer on three cards; the stage said on its tone. Items…
- Return request: Staff start a return from an order, and edit the reasons customers pick. New return: the order's lines as a checklist, each with its variant, price and…
- Purchase orders: A salon's purchase orders, received: the orders down the side, the chosen one beside them. Each line still due reads as a strip of received, this…
- Print quote: A print shop's quoting in three places. Quote: a group of garments that share one imprint and one quantity break, the group's pieces counted together and…
- Service estimate: An estimate for one vehicle. Services added from the catalogue (one not listed for this vehicle said on warning, fit unknown said); each with its lines…
- Job card: A technician's repair order, phone-first. The vehicle, the customer and when it's due in words (due at, due in, overdue by how long); an offline copy…
- Parts tracker: Parts across a shop's work orders: each with its number, the order and vehicle, supplier, quantity and cost (not known said), and where it is: ordered…
- Visit board: The staff board for a walk-in queue: visits move from waiting through called and serving to done today. Arrival (here or on the way), the place in the…