UX.SOL

Component

Coin Price Tooltip

Shows a token price summary with optional trend details in a tooltip.

Preview

Installation

terminal
$npx shadcn@latest add https://uxdotsol.xyz/r/coin-price.json

Usage

usage
import { CoinPrice } from "@/components/coin-price";
 
export default function App() {
return (
<div className="flex justify-center p-8">
<CoinPrice tokenName="solana" />
</div>
);
}
.env.local
# .env.local
COINGECKO_API_KEY=your_server_side_key

Props / Arguments

NameTypeDefaultDescription
tokenNamestring'solana'Optional token name/id passed to the API as tokenName. Examples: solana, bitcoin, ethereum.
apiUrlstring'/api/coin-price'Optional backend endpoint. Keep provider keys on the server; do not pass secret-bearing URLs to the client.
classNamestringundefinedOptional class forwarded to the outer wrapper.