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.- 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.- 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.- 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.- 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.- 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.open: boolean- Current open statesetOpen: (open: boolean) => void- Update open statesymbols: AssetPairOption[]- Available symbolssymbolMap: Map<string, AssetPairOption>- Symbol lookup maploading: boolean- Loading stateerror: Error | null- Error stateselectedSymbol: AssetPairOption | null- Currently selected symbol objectcurrentSymbol: string- Current symbol string valueonSelectSymbol: (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
Notes
The SymbolCombobox must be used within an
OrderbookProvider or Orderbook.RootProvider context to access symbol data and update the orderbook.
