Murphy Logo Murphy

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

NameTypeDefault
assetsSolAsset[][]
triggerReact.ReactNode
addressPublicKey | null
showBalancesbooleantrue
onSelect(asset: SolAsset) => void
onSearch(query: string) => Promise<SolAsset[]>

On this page

How are you feeling?

Join Our Community