Skip to main content
The OrderbookControls component provides time-travel functionality for reviewing historical orderbook states with playback controls and timeline navigation.

Basic Usage

Anatomy

Examples

Complete Control Panel

Full-featured control panel with all available controls.

Minimal Controls

Simple control setup with just playback buttons.

Custom Styling

Apply custom styling to control components.

With Orderbook Integration

Integrate controls directly with the Orderbook component.

Only Timeline

Display just the timeline scrubber without buttons.

With Settings

Combine controls with settings panel.

Components

Root

Wrapper component that provides context for all control elements.

LiveBadge

Indicator showing whether the orderbook is displaying live data or historical replay.
Displays:
  • LIVE badge when showing real-time data
  • REPLAY badge when in historical playback mode

PlaybackButtons

Control buttons for playback navigation.
Features:
  • Play/Pause toggle
  • Step backward (previous frame)
  • Step forward (next frame)
  • Return to live mode

Timeline

Interactive timeline slider for scrubbing through historical data.
Features:
  • Drag to scrub through history
  • Click to jump to specific point
  • Visual representation of current position
  • Timestamp display

Toolbar

Container for organizing multiple control elements in a horizontal layout.

Props

Root

ReactNode
required
Control components to render.
string
Additional CSS classes for styling.

LiveBadge

string
Additional CSS classes for styling the badge.

PlaybackButtons

string
Additional CSS classes for styling the button group.

Timeline

string
Additional CSS classes for styling the timeline.

Toolbar

ReactNode
required
Control components to display in the toolbar.
string
Additional CSS classes for styling the toolbar.

Playback Behavior

The controls automatically manage orderbook playback state:
  1. Live Mode: Default state showing real-time data
  2. Replay Mode: Activated when interacting with timeline or playback buttons
  3. Auto-resume: Optionally return to live mode after reaching the end of historical data

Notes

OrderbookControls must be used within an OrderbookProvider or Orderbook.RootProvider context to function properly.
The Timeline component provides smooth scrubbing with debounced updates to prevent excessive re-renders during rapid seeking.
Playback functionality requires historical data to be available. The controls will be disabled if no historical data is present.