Skip to main content
The SymbolCombobox component provides a user-friendly interface for searching and selecting trading pairs from available asset pairs.

Basic Usage

Anatomy

Examples

With Orderbook Integration

The symbol combobox automatically connects to the orderbook context and updates the trading pair.

Custom Trigger Button

Customize the appearance of the trigger button.

Custom Content Width

Adjust the width of the dropdown content.

Custom Item Rendering

Use the Item component directly for complete customization.

Controlled State

Control the open/close state externally.

In Navigation Bar

Place the symbol selector in a navigation bar.

With Custom Icon

Customize the icon display for each symbol.

Components

Root

Wrapper component that provides context and manages state.
Features:
  • Manages open/close state
  • Fetches available symbols from asset pairs configuration
  • Handles symbol selection and orderbook updates
  • Provides context to child components

Trigger

Button that opens the symbol selection dropdown.
Features:
  • Shows currently selected symbol with icon
  • Displays loading state while fetching symbols
  • Automatically disabled during loading or on error
  • Supports custom children for complete customization

Content

Dropdown panel containing the symbol list and search.
Features:
  • Built-in search functionality
  • Loading and error states
  • Empty state when no symbols found
  • Default implementation with Command component
  • Supports custom children for full control

Item

Individual symbol item in the dropdown list.
Features:
  • Displays symbol icon and label
  • Shows check mark for selected symbol
  • Handles click/keyboard selection
  • Supports custom children for layout control

Icon

Symbol icon component with automatic fallback.
Features:
  • Loads symbol icon from URL
  • Automatic fallback to first letter on error
  • Consistent sizing and styling

Props

Root

boolean
Controlled open state of the dropdown.
(open: boolean) => void
Callback fired when the open state changes.

Trigger

string
Additional CSS classes for styling the trigger button.
ReactNode
Custom content to display in the trigger. When provided, replaces the default symbol display.

Content

string
Additional CSS classes for styling the dropdown content.Default: "w-60 p-0"
ReactNode
Custom content to display in the dropdown. When provided, replaces the default command list.

Item

AssetPairOption
required
The symbol option data to display.
boolean
required
Whether this symbol is currently selected.
(value: string) => void
required
Callback fired when the symbol is selected.
string
Additional CSS classes for styling the item.
ReactNode
Custom content to display. When provided, replaces the default label.

Icon

string
required
URL of the icon image.
string
required
Alt text for the icon (used in fallback).
string
Additional CSS classes for styling the icon.

Context Hook

Access the symbol combobox context in custom components.
Context Properties:
  • open: boolean - Current open state
  • setOpen: (open: boolean) => void - Update open state
  • symbols: AssetPairOption[] - Available symbols
  • symbolMap: Map<string, AssetPairOption> - Symbol lookup map
  • loading: boolean - Loading state
  • error: Error | null - Error state
  • selectedSymbol: AssetPairOption | null - Currently selected symbol object
  • currentSymbol: string - Current symbol string value
  • onSelectSymbol: (value: string) => void - Select symbol handler

Search Behavior

The built-in search matches against:
  • Symbol value (e.g., “BTC/USD”)
  • Display label
  • Alternative name
  • Base and quote assets
The search is case-insensitive and updates results in real-time.

Notes

The SymbolCombobox must be used within an OrderbookProvider or Orderbook.RootProvider context to access symbol data and update the orderbook.
The component automatically handles symbol initialization, selecting the first available symbol if none is set.