Skip to content

API Reference

Usage guide and complete API reference for react-web3-icons.

Getting Started

Install via your package manager:

npm install react-web3-icons
# or
pnpm add react-web3-icons
# or
yarn add react-web3-icons

Import and use any icon component:

import { Ethereum, BitcoinCircle, MetaMask } from 'react-web3-icons';

export function MyComponent() {
  return (
    <div>
      <Ethereum size={32} />
      <BitcoinCircle className="text-orange-500" size={48} />
      <MetaMask title="MetaMask wallet" size={24} />
    </div>
  );
}

Icon Props

All icon components accept the following props in addition to standard SVG attributes.

Icon component props
PropTypeDefaultDescription
sizestring | number"1em"Sets both width and height. Accepts any valid CSS size or a unitless number (treated as pixels).
classNamestring—CSS class applied to the root <svg>. Use text-* utilities to set the color of currentColor mono icons.
titlestring—Accessible label rendered as a <title> element inside the SVG. When provided, aria-hidden is removed automatically.
titleIdstring—Optional ID for the <title> element. When both title and titleId are provided, the SVG sets aria-labelledby to that ID.
aria-hiddenbooleantrueDefaults to true (decorative). Set to false or supply a title to expose the icon to screen readers.
styleCSSProperties—Inline styles applied to the SVG element.

Import Patterns

Two ways to import icons:

Named import from root entry

import { Ethereum, BitcoinMono } from 'react-web3-icons';

Category subpath (tree-shakes the same, grouped by category)

import { Ethereum } from 'react-web3-icons/chain';
import { Bitcoin, Doge } from 'react-web3-icons/coin';
import { MetaMask } from 'react-web3-icons/wallet';

Available subpath categories

react-web3-icons/bridge
react-web3-icons/chain
react-web3-icons/coin
react-web3-icons/defi
react-web3-icons/devtool
react-web3-icons/dex
react-web3-icons/domain
react-web3-icons/exchange
react-web3-icons/explorer
react-web3-icons/marketplace
react-web3-icons/node
react-web3-icons/oracle
react-web3-icons/portfolio
react-web3-icons/storage
react-web3-icons/tracker
react-web3-icons/wallet

Dynamic Components

react-web3-icons/dynamic resolves an icon from runtime data (chain ID, slug, ticker, wallet connector id) and lazy-loads only that icon's chunk. These are client components ('use client'); each wraps the lazy icon in its own <Suspense>.

import { ChainIcon, CoinIcon, WalletIcon } from 'react-web3-icons/dynamic';

<ChainIcon chainId={chain.id} name={chain.slug} size={24} />
<CoinIcon symbol={token.symbol} variant="mono" fallback={<Placeholder />} />
<WalletIcon name={connector.id} variant="Square" />
Dynamic icon components, their identifier props and variants
ComponentIdentifier propsResolved viaVariants besides colored and mono
ChainIconchainId: ChainId | number, name: ChainSlug | string, or bothCHAIN_ID_TO_NAME, CHAIN_SLUG_TO_NAMECircle, CircleMono, Square, SquareMono
CoinIconsymbol: Ticker | stringTICKER_TO_COINAlt, Circle, CircleMono, Square, SquareMono
WalletIconname: WalletSlug | stringWALLET_SLUG_TO_NAMECircle, CircleMono, Square, SquareMono, Symbol, SymbolMono
ExchangeIconname: ExchangeSlug | stringEXCHANGE_SLUG_TO_NAMECircle, CircleAlt, CircleMono, Inverted, Square, SquareMono
DefiIconname: DefiSlug | stringDEFI_SLUG_TO_NAMECircle, CircleMono, Square, SquareMono
DexIconname: DexSlug | stringDEX_SLUG_TO_NAMECircle, CircleMono, Inverted, Square, SquareMono
BridgeIconname: BridgeSlug | stringBRIDGE_SLUG_TO_NAMEInverted
OracleIconname: OracleSlug | stringORACLE_SLUG_TO_NAME—

Every dynamic component also accepts:

  • variant — 'colored' (the default), 'mono' (the <Name>Mono export), or a variant suffix of the category from the table ('Circle' loads <Name>Circle). The prop is typed with the category's union (ChainVariant, CoinVariant, …), exported from react-web3-icons/dynamic, so a typo is a type error. Not every icon ships every variant of its category; check the manifest's variants.
  • fallback?: ReactNode — rendered while the chunk loads, when the identifier is not recognized (including undefined or null from untyped data), when the variant is unknown or the icon does not ship it, and when the chunk fails to load (a later render retries the import). Default: nothing.
  • All icon props (size, className, title, …) and ref, forwarded to the loaded icon's <svg>.

Names, slugs and tickers resolve through the metadata maps, with both sides normalized the same way: lowercased, with whitespace, ., - and _ removed. So 'Arbitrum Nova', 'arbitrum_nova' and 'arbitrum-nova' are the same key, as are 'Ether.fi' / 'etherfi' and 'eth' / 'ETH'. The keys include legacy names, the manifest's search aliases and common wallet connector ids ('metaMaskSDK', 'walletConnect', …).

ChainIcon needs chainId or name. chainId takes precedence; an unknown chainId falls back to name, so <ChainIcon chainId={chain.id} name={chain.slug} /> still renders a chain without a registered ID.

Identifier props autocomplete the known keys but accept any string (and chainId any number), so values from API data type-check; one that matches nothing renders fallback. In development builds, an unknown identifier, an unknown or missing variant and a failed load each log one console.warn; production builds strip these warnings. Details: README, Dynamic Icon Components.

Metadata Maps

react-web3-icons/meta exports the plain lookup tables behind the dynamic components. Each maps an identifier to an icon base name (append Mono for the monochrome export), has a matching key type for narrowing, and works in server components:

Metadata lookup maps
ExportKey typeKeyIcons fromEntries
CHAIN_ID_TO_NAMEChainIdEVM chain ID (1, 8453, …)chain44
CHAIN_SLUG_TO_NAMEChainSlugLowercase slug ('arbitrum')chain83
TICKER_TO_COINTickerUppercase ticker ('ETH')coin120
WALLET_SLUG_TO_NAMEWalletSlugLowercase slug ('metamask')wallet49
EXCHANGE_SLUG_TO_NAMEExchangeSlugLowercase slug ('binance')exchange21
DEFI_SLUG_TO_NAMEDefiSlugLowercase slug ('etherfi')defi31
DEX_SLUG_TO_NAMEDexSlugLowercase slug ('uniswap')dex23
BRIDGE_SLUG_TO_NAMEBridgeSlugLowercase slug ('layerzero')bridge11
ORACLE_SLUG_TO_NAMEOracleSlugLowercase slug ('pyth')oracle4
import { CHAIN_ID_TO_NAME, type ChainId } from 'react-web3-icons/meta';
import * as chains from 'react-web3-icons/chain'; // bundles every chain icon

function isChainId(id: number): id is ChainId {
  return Object.hasOwn(CHAIN_ID_TO_NAME, id);
}

function ChainLogo({ chainId }: { chainId: number }) {
  if (!isChainId(chainId)) return null;
  const Icon = chains[CHAIN_ID_TO_NAME[chainId]]; // 8453 → Base
  return <Icon size={20} />;
}

Naming Conventions

Icon names use PascalCase. Variant suffixes describe visual differences:

Naming convention suffixes
SuffixDescription
(none)Default colored variant
MonoSingle-color; uses currentColor — controlled via CSS color
CircleIcon enclosed in a circle background
CircleMonoCircle variant in single-color
SquareIcon enclosed in a square/rounded background
SquareMonoSquare variant in single-color
WordmarkFull logo with logotype text
WordmarkMonoWordmark in single-color
SymbolStandalone symbol without the container the default has
SymbolMonoSymbol variant in single-color
FlatSingle-color simplification of the default design
AltMeaningfully different design or color scheme
CircleAltCircle variant in an alternative color scheme
InvertedColors reworked for dark backgrounds; same shape as the default
LightLegacy, closed to new icons: only BlastscanLight, the official dark single-color mark for light backgrounds (the default is pale). New icons use Flat for a version in one brand color and Mono for a black one.

Example: Ethereum, EthereumMono, EthereumCircle, EthereumCircleMono

Deprecation Policy

Renamed exports, including rebrands that kept their artwork, stay as deprecated aliases of the new name. When a rebrand brings new artwork, or a project shuts down, the old export keeps its old artwork and is deprecated. Deprecated exports are removed only in a major release, after at least one minor release and 90 days.

A DEPRECATED_ICON_NAMES set is exported to help you filter deprecated exports at runtime:

import { DEPRECATED_ICON_NAMES } from 'react-web3-icons';
// or from its own subpath:
import { DEPRECATED_ICON_NAMES } from 'react-web3-icons/deprecated';

const iconNames = ['Ethereum', 'Argent', 'Ready'];
const current = iconNames.filter(name => !DEPRECATED_ICON_NAMES.has(name));
// ['Ethereum', 'Ready']

To list the current icons, use the manifest, which flags deprecated entries itself. Object.keys() on import * as icons also works, but it bundles the whole library.

import { ICON_MANIFEST } from 'react-web3-icons/manifest';

// A Set, because an icon exported from two categories (e.g. Sonic) has two entries
const activeIconNames = new Set(
  ICON_MANIFEST.filter(e => !e.deprecated).map(e => e.name),
);

React Server Components

Static icons call no hooks other than useId, which React supports in Server Components, and icons without internal ids (masks, gradients, clip paths) call no hooks at all. They render in React Server Components with no 'use client' directive:

// app/page.tsx — Server Component, no directive needed
import { Ethereum } from 'react-web3-icons';

export default function Page() {
  return <Ethereum size={24} />;
}

Only the dynamic components (react-web3-icons/dynamic) are client-only — they lazy-load icon chunks at runtime.

Beyond React

The same icon set ships in three framework-agnostic forms. Raw SVG files live under the svg/ subpath:

import ethereumSvgUrl from 'react-web3-icons/svg/chain/Ethereum.svg';
// or on a CDN:
// https://cdn.jsdelivr.net/npm/react-web3-icons@5.1.0/dist/svg/chain/Ethereum.svg

Pin an exact version: a URL without one, or with @latest, can start serving different files whenever a new version is published. Details: README, Raw SVG Files.

IconifyJSON collections (web3 colored, web3-mono currentColor) work with Iconify's React, Vue, Svelte, and Web Component packages and with unplugin-icons:

npm install @iconify/react
import { addCollection, Icon } from '@iconify/react';
import web3Icons from 'react-web3-icons/iconify.json';

addCollection(web3Icons);
<Icon icon="web3:chain-ethereum" />;

The manifest is a flat catalog of every export (name, category, and any registered chain ID / slug / ticker); the base entry of each icon, re-exports included, also carries its variants and brand color, plus any search aliases. Built for icon pickers and search indexes:

import { ICON_MANIFEST } from 'react-web3-icons/manifest';

const chains = ICON_MANIFEST.filter(
  e => e.category === 'chain' && !e.deprecated && e.variants,
);
// [{ name: 'Ethereum', chainId: 1, slug: 'ethereum', variants: ['', 'Mono', …], brandColor: '#…' }, …]

TypeScript

The IconName union type enumerates every exported icon name. Collect the icons you need in a map: only the listed icons are bundled, and satisfies rejects names that don't exist:

import { Arbitrum, Base, Ethereum, type IconName } from 'react-web3-icons';

const ICONS = { Arbitrum, Base, Ethereum } satisfies Partial<Record<IconName, unknown>>;

function NamedIcon({ name, size }: { name: keyof typeof ICONS; size?: number }) {
  const Icon = ICONS[name];
  return <Icon size={size} />;
}

Accepting any IconName at runtime (import * as icons and icons[name]) bundles the whole library. To resolve icons from runtime data, use the dynamic components, which load one icon at a time.