Skip to content

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
Terminal window
npx shadcn@latest add @0xui/chain-badge
import { 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.

EthereumBase
<ChainBadge chainId={1} iconOnly />

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.