TokenInput
A token selection component with a searchable token list and balance display.
TokenInput
The TokenInput component provides a token selection interface with a modal dialog containing a searchable list of tokens.
Usage
Props
Prop | Type | Default | Description |
---|---|---|---|
selected | { address: string } & Partial<TokenItem> | - | Currently selected token |
chain_id | number | - | Chain ID for the token list |
list | TokenItem[] | - | Array of available tokens |
onSelectionChanged | (token: TokenItem) => void | - | Called when token selection changes |
showBalances | boolean | - | Whether to show token balances |
className | string | - | Additional CSS classes |
Features
- Token selection through modal dialog
- Displays token icon and symbol
- Shows token balances (optional)
- Searchable token list
- Uses TokenChip for selected token display
- Responsive dialog design
Examples
Basic Token Selection
With Balances
In a Form
Custom Styling
Component Structure
-
Trigger
- TokenChip showing selected token
- Chevron down indicator
- Click to open dialog
-
Dialog
- Header with back button
- Search input
- Scrollable token list
- Token balances (if enabled)
Token Item Structure
Edit on GitHub
Last updated on