Components
Chain Badge
Static chain chip with icon and name.
Labels a chain, e.g. where a token lives or which network a transaction ran on. It doesn’t switch chains. Use Chain Selector for that.
EthereumBaseSepoliaChain 424242
Installation
Section titled “Installation”npx shadcn@latest add @0xui/chain-badgepnpm dlx shadcn@latest add @0xui/chain-badgeyarn dlx shadcn@latest add @0xui/chain-badgebunx --bun shadcn@latest add @0xui/chain-badgeimport { ChainBadge } from "@/components/chain-badge";
<ChainBadge chainId={8453} />;The name comes from your wagmi config. Chains that aren’t configured show as “Chain <id>”, unless you pass name.
Examples
Section titled “Examples”Icon only
Section titled “Icon only”EthereumBase
<ChainBadge chainId={1} iconOnly />Just the icon
Section titled “Just the icon”ChainIcon is the logo on its own, with a placeholder for unknown chains. Other 0xui components reuse it.
import { ChainIcon } from "@/components/chain-badge";
<ChainIcon chainId={1} variant="branded" className="size-8" />;Also accepts all <span> props.
| Prop | Type | Default | Description |
|---|---|---|---|
chainId |
number |
— | Chain to show. |
name |
string |
from config | Display name. |
iconOnly |
boolean |
false |
Hide the name visually. It stays accessible. |
variant |
"background" | "branded" | "mono" |
"background" |
Icon style. |
chainIcon |
ComponentType<ChainIconProps> | false |
ChainIcon |
Custom icon, or false to hide it. |
