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

Network Logo

Displays a network or chain logo from an EVM chain id.

Use NetworkLogo for chain selectors, token badges, bridge routes, wallet rows, and cross-chain asset views. Pass a supported chainId and the matching network logo renders automatically.

Loading...
network-logo.tsxShow code
import { NetworkLogo } from "@/components/ui/network-logo"export function NetworkLogoDemo() {  return <NetworkLogo chainId={8453} showTooltip />}

Installation

npx shadcn add https://onchain-ui.dev/r/network-logo.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 { NetworkLogo } from "@/components/ui/network-logo"

<NetworkLogo chainId={8453} />

NetworkLogo ships with built-in logos for common EVM networks. Use src only when you need to override a logo or support a chain that is not built in yet.

See Icon Resolution for the full network and token icon strategy.

Supported Chains

ChainchainId
Ethereum1
Optimism10
Polygon137
Base8453
Arbitrum One42161

Examples

Networks

Loading...
network-logo-networks.tsxShow code
import { NetworkLogo } from "@/components/ui/network-logo"export function NetworkLogoNetworks() {  return (    <div className="flex items-center gap-3">      <NetworkLogo chainId={1} />      <NetworkLogo chainId={8453} />      <NetworkLogo chainId={10} />      <NetworkLogo chainId={42161} />      <NetworkLogo chainId={137} />    </div>  )}

Sizes

Loading...
network-logo-sizes.tsxShow code
import { NetworkLogo } from "@/components/ui/network-logo"export function NetworkLogoSizes() {  return (    <div className="flex items-center gap-3">      <NetworkLogo chainId={8453} size="xs" />      <NetworkLogo chainId={8453} size="sm" />      <NetworkLogo chainId={8453} size="md" />      <NetworkLogo chainId={8453} size="lg" />      <NetworkLogo chainId={8453} size="xl" />    </div>  )}

Custom Network

Z
network-logo-custom.tsxShow code
import { NetworkLogo } from "@/components/ui/network-logo"export function NetworkLogoCustom() {  return (    <NetworkLogo      name="Zora"      symbol="ZORA"      fallback="Z"      className="border-foreground/20 bg-foreground text-background"      showTooltip    />  )}

Props

PropTypeDefaultDescription
chainIdnumber | null-EVM chain id
srcstring | nullBuilt-in chain logoNetwork image URL override
namestring | nullBuilt-in network nameNetwork name
symbolstring | nullBuilt-in network symbolShort symbol for fallback
size"xs" | "sm" | "md" | "lg" | "xl""md"Visual size
fallbackReactNodeSymbol/name/chain fallbackCustom fallback for unsupported chains
showTooltipbooleanfalseShow an animated tooltip
tooltipContentReactNodeName, symbol, then chain idTooltip content
classNamestring-Applied to the root wrapper
imageClassNamestring-Applied to the image
fallbackClassNamestring-Applied to the fallback

On this page