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-iconsImport 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.
| Prop | Type | Default | Description |
|---|---|---|---|
| size | string | number | "1em" | Sets both width and height. Accepts any valid CSS size or a unitless number (treated as pixels). |
| className | string | — | CSS class applied to the root <svg>. Use text-* utilities to set the color of currentColor mono icons. |
| title | string | — | Accessible label rendered as a <title> element inside the SVG. When provided, aria-hidden is removed automatically. |
| titleId | string | — | Optional ID for the <title> element. When both title and titleId are provided, the SVG sets aria-labelledby to that ID. |
| aria-hidden | boolean | true | Defaults to true (decorative). Set to false or supply a title to expose the icon to screen readers. |
| style | CSSProperties | — | 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/walletDynamic 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" />| Component | Identifier props | Resolved via | Variants besides colored and mono |
|---|---|---|---|
| ChainIcon | chainId: ChainId | number, name: ChainSlug | string, or both | CHAIN_ID_TO_NAME, CHAIN_SLUG_TO_NAME | Circle, CircleMono, Square, SquareMono |
| CoinIcon | symbol: Ticker | string | TICKER_TO_COIN | Alt, Circle, CircleMono, Square, SquareMono |
| WalletIcon | name: WalletSlug | string | WALLET_SLUG_TO_NAME | Circle, CircleMono, Square, SquareMono, Symbol, SymbolMono |
| ExchangeIcon | name: ExchangeSlug | string | EXCHANGE_SLUG_TO_NAME | Circle, CircleAlt, CircleMono, Inverted, Square, SquareMono |
| DefiIcon | name: DefiSlug | string | DEFI_SLUG_TO_NAME | Circle, CircleMono, Square, SquareMono |
| DexIcon | name: DexSlug | string | DEX_SLUG_TO_NAME | Circle, CircleMono, Inverted, Square, SquareMono |
| BridgeIcon | name: BridgeSlug | string | BRIDGE_SLUG_TO_NAME | Inverted |
| OracleIcon | name: OracleSlug | string | ORACLE_SLUG_TO_NAME | — |
Every dynamic component also accepts:
variant—'colored'(the default),'mono'(the<Name>Monoexport), 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 fromreact-web3-icons/dynamic, so a typo is a type error. Not every icon ships every variant of its category; check the manifest'svariants.fallback?: ReactNode— rendered while the chunk loads, when the identifier is not recognized (includingundefinedornullfrom 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, …) andref, 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:
| Export | Key type | Key | Icons from | Entries |
|---|---|---|---|---|
| CHAIN_ID_TO_NAME | ChainId | EVM chain ID (1, 8453, …) | chain | 44 |
| CHAIN_SLUG_TO_NAME | ChainSlug | Lowercase slug ('arbitrum') | chain | 83 |
| TICKER_TO_COIN | Ticker | Uppercase ticker ('ETH') | coin | 120 |
| WALLET_SLUG_TO_NAME | WalletSlug | Lowercase slug ('metamask') | wallet | 49 |
| EXCHANGE_SLUG_TO_NAME | ExchangeSlug | Lowercase slug ('binance') | exchange | 21 |
| DEFI_SLUG_TO_NAME | DefiSlug | Lowercase slug ('etherfi') | defi | 31 |
| DEX_SLUG_TO_NAME | DexSlug | Lowercase slug ('uniswap') | dex | 23 |
| BRIDGE_SLUG_TO_NAME | BridgeSlug | Lowercase slug ('layerzero') | bridge | 11 |
| ORACLE_SLUG_TO_NAME | OracleSlug | Lowercase slug ('pyth') | oracle | 4 |
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:
| Suffix | Description |
|---|---|
| (none) | Default colored variant |
| Mono | Single-color; uses currentColor — controlled via CSS color |
| Circle | Icon enclosed in a circle background |
| CircleMono | Circle variant in single-color |
| Square | Icon enclosed in a square/rounded background |
| SquareMono | Square variant in single-color |
| Wordmark | Full logo with logotype text |
| WordmarkMono | Wordmark in single-color |
| Symbol | Standalone symbol without the container the default has |
| SymbolMono | Symbol variant in single-color |
| Flat | Single-color simplification of the default design |
| Alt | Meaningfully different design or color scheme |
| CircleAlt | Circle variant in an alternative color scheme |
| Inverted | Colors reworked for dark backgrounds; same shape as the default |
| Light | Legacy, 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.svgPin 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/reactimport { 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.