Token Combobox
A searchable combobox of tokens and prices with optional user balances.
Token Combobox
Installation
Install shadcn/ui popover and command components
npx shadcn@latest add popover command
Install Murphy TokenIcon
pnpm dlx shadcn@canary add https://www.murphyai.dev/r/token-icon.json
Install Murphy Token Combobox
pnpm dlx shadcn@canary add https://www.murphyai.dev/r/token-combobox.json
Add your Bird Eye API key to .env
NEXT_PUBLIC_BIRDEYE_API_KEY="bird-eye-api-key"
Basic Usage
import {TokenCombobox} from "@/components/ui/murphy/token-combobox.tsx"
<TokenCombobox
assets={assets}
address={publicKey}
showBalances={!!publicKey}
onSearch={searchAssets}
/>
Props
Name | Type | Default |
---|---|---|
assets | SolAsset[] | [] |
trigger | React.ReactNode | |
address | PublicKey | null | |
showBalances | boolean | true |
onSelect | (asset: SolAsset) => void | |
onSearch | (query: string) => Promise<SolAsset[]> |