Alphaonchain-ui is experimental. Components, docs, and registry URLs may change before a stable release.
onchain-ui
Components

Asset Row

Displays a practical portfolio or watchlist row from token identity, network, amount, value, and change.

Use AssetRow when you need the composed version of the primitives: wallet assets, watchlists, portfolio tables, token selectors, and positions.

Loading...
asset-row.tsxShow code
import { AssetRow } from "@/components/ui/asset-row"export function AssetRowDemo() {  return (    <AssetRow      symbol="USDC"      name="USD Coin"      amount={1842.2}      value={1842.2}      change={0.01}      chainId={8453}      subtitle="Base"    />  )}

Installation

npx shadcn add https://onchain-ui.dev/r/asset-row.json
Open in

Requirements

Tooltips compose the standard shadcn tooltip. The install adds it if your app does not already have components/ui/tooltip.tsx; if you do, your existing (possibly customized) tooltip is used as-is. Wrap your app with TooltipProvider if you have not already.

Usage

import { AssetRow } from "@/components/ui/asset-row"

<AssetRow
  symbol="USDC"
  name="USD Coin"
  amount={1842.2}
  value={1842.2}
  change={0.01}
  chainId={8453}
  subtitle="Base"
/>

AssetRow composes TokenLogo, NetworkLogo, and TokenPrice. Use it as a starting point for product surfaces, then pass class hooks or child props when your app needs a tighter treatment.

Examples

Portfolio

Loading...
asset-row-portfolio.tsxShow code
import { AssetRow } from "@/components/ui/asset-row"export function AssetRowPortfolio({ assets }) {  return (    <div className="grid gap-2">      {assets.map((asset) => (        <AssetRow key={asset.symbol} {...asset} />      ))}    </div>  )}

Watchlist

Hide the amount to use the same row shape for market and watchlist views.

Loading...
asset-row-watchlist.tsxShow code
import { AssetRow } from "@/components/ui/asset-row"export function AssetRowWatchlist({ assets }) {  return (    <div className="grid gap-2">      {assets.map((asset) => (        <AssetRow          key={asset.symbol}          {...asset}          hideAmount          priceProps={{ showChangeIcon: false }}        />      ))}    </div>  )}

Props

PropTypeDefaultDescription
symbolstring-Token symbol
namestring | null-Token name
srcstring | null-Token image URL
addressstring | null-Token contract address, used for icon inference and as a fallback label
amountnumber | string | null | undefined-Token amount held by the user
valueTokenPriceProps["value"]-Fiat value for the position
changenumber | null-Price or position change percentage
chainIdnumber | null-Network chain id for the logo badge
networkNamestring | null-Network name for the logo badge
networkSrcstring | null-Network image URL for the logo badge
subtitleReactNode-Secondary metadata under the token name
hideAmountbooleanfalseHide the right-side token amount
localestringBrowser/default localeLocale passed to Intl.NumberFormat
maximumFractionDigitsnumber4Maximum fraction digits for token amount
logoPropsPartial<TokenLogoProps>-Props passed to TokenLogo
networkLogoPropsPartial<NetworkLogoProps>-Props passed to NetworkLogo
pricePropsPartial<TokenPriceProps>-Props passed to TokenPrice
classNamestring-Applied to the root wrapper
identityClassNamestring-Applied to the token identity block
valueClassNamestring-Applied to the right-side value block

On this page