---
title: "Asset Icon"
description: "Shows the mark of an asset: a flag for a currency, a logo for a coin or token with its network, or letters when there is no logo."
url: https://gelatinui.com/components/asset-icon
markdown_url: https://gelatinui.com/components/asset-icon.md
access: free
install: "npx shadcn@latest add @gelatin-ui/asset-icon"
registry_item: https://gelatinui.com/r/asset-icon.json
version: "2026-11-12"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Asset Icon

> Shows the mark of an asset: a flag for a currency, a logo for a coin or token with its network, or letters when there is no logo.

Page: https://gelatinui.com/components/asset-icon

## When to use it

Best for: One mark for money, coins, metals, and points, at the sizes of an Avatar.

- Use it next to an asset code in a list, a picker, a field, or a receipt.
- Give `country` for money, `logoUrl` or `logo` for a token, and `network` for its badge.
- Set `listed: false` on a token found by address, so it shows a dashed warning edge.

## When not to use it

- For a flag alone, use a [Country Flag](https://gelatinui.com/components/country-flag.md).
- For a person, use an [Avatar](https://gelatinui.com/components/avatar.md).

## Notes for agents

- Pass `asset` with `kind`, `code`, and `name`. Money with `country` shows its round flag; `logo` (BrandMark data) wins over `logoUrl`.
- With no picture, or while it loads or fails, it shows 1 to 3 letters of the code in one of five chart tones, picked by the code.
- The network badge is 40% of the icon in the bottom end corner. It hides at `xs`.
- Points, stocks, and metals use a square corner; money and coins are round.
- It is decorative next to a written code. Pass `aria-label` when it stands alone.

## Anatomy

```text
AssetIcon
├─ AssetIconImage (0..n)
├─ AssetIconFallback (0..n)
└─ AssetIconNetwork (0..n)
```

## API reference

### AssetIcon

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `size` | `"default" \| "lg" \| "sm" \| "xl" \| "xs"` | "default" |  |
| `asset` | `Asset` |  | The asset to draw: its kind picks a flag, a token mark, a logo, or letters. |
| `children` | `ReactNode` |  | The parts. Default: the picture, the letters fallback, and the network badge. |

### AssetIconImage

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### AssetIconFallback

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `children` | `ReactNode` |  | The text. Default: the letters of the code (`?` for an asset that is not listed). |

Also takes every prop of Base UI `Avatar.Fallback`: https://base-ui.com/react/components/avatar

### AssetIconNetwork

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` |  | The badge content. Default: the network mark. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| AssetIcon | `asset-icon` |  |  | `status-colors` |
| AssetIconImage | `asset-icon-image` | `data-size` |  |  |
| AssetIconFallback | `asset-icon-fallback` | `data-size` |  | `status-colors` |
| AssetIconNetwork | `asset-icon-network` | `data-size` |  |  |

## Usage

Place the picture, the letters fallback, and the network badge in the icon; the letters show while the logo loads or when it fails.

```tsx title="token-row.tsx"
import {
  AssetIcon,
  AssetIconFallback,
  AssetIconImage,
  AssetIconNetwork,
} from "@/components/ui/asset-icon";
import type { Asset } from "@/lib/asset-model";

const ICONS = "https://cdn.jsdelivr.net/npm/cryptocurrency-icons@0.18.1/svg/color";

const USDC: Asset = {
  id: "usdc-ethereum",
  kind: "crypto",
  code: "USDC",
  name: "USD Coin",
  decimals: 6,
  logoUrl: `${ICONS}/usdc.svg`,
  network: { id: "ethereum", name: "Ethereum", logoUrl: `${ICONS}/eth.svg` },
};

export function TokenRow() {
  return (
    <div className="flex items-center gap-3">
      <AssetIcon asset={USDC} size="lg">
        <AssetIconImage />
        <AssetIconFallback />
        <AssetIconNetwork />
      </AssetIcon>
      <span className="flex flex-col">
        <span className="text-sm font-medium">USDC</span>
        <span className="text-xs text-muted-foreground">USD Coin · Ethereum</span>
      </span>
    </div>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/asset-icon
```

It adds 20 registry items: 17 files, 2815 lines, and the npm packages `@base-ui/react`, `@phosphor-icons/react`, `clsx`, `country-flag-icons`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Avatar](https://gelatinui.com/components/avatar.md)
- [Country Flag](https://gelatinui.com/components/country-flag.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Avatar](https://gelatinui.com/components/avatar.md)
- [Country Flag](https://gelatinui.com/components/country-flag.md)
- [Asset Picker](https://gelatinui.com/components/asset-picker.md)
