For isolated previews, theme switching, and sandbox editing, open the TokenAmount playground on holydocs.com .

When to use

Use this component when blockchain context, addresses, chains, token math, or wallet onboarding must stay precise and scannable.

Live Examples

Every example below renders the real component directly inside HolyDocs, followed by the exact MDX you can paste into a page.

Native Token

Humanize an 18-decimal native asset balance.

1 ETH
mdx
<TokenAmount value="1000000000000000000" decimals={18} symbol="ETH" />

Stablecoin

6-decimal assets like USDC remain precise without extra formatting work.

12.5 USDC
mdx
<TokenAmount value="12500000" decimals={6} symbol="USDC" />

Large Treasury Balance

Large raw values still render cleanly for dashboards or treasury docs.

2504.5 MNT
mdx
<TokenAmount value="2504500000000000000000" decimals={18} symbol="MNT" />

Props

PropTypeDefaultDescription
valuestring0Raw integer token amount, usually straight from an RPC response.
decimalsnumber18Number of decimal places used by the token.
symbolstring--Optional token symbol appended to the formatted value.

Usage

Start from this baseline shape and then tailor the copy, data, or nesting to the page you are writing.

mdx
<TokenAmount value="1000000000000000000" decimals={18} symbol="ETH" />

Tips

  • Assume readers are one copy action away from using the value in production. Precision matters more than flair on web3 surfaces.
  • Always make the target chain explicit when a component can imply a wallet, explorer, or transaction context.
  • Use testnet examples unless the page is explicitly about production contracts or addresses you expect people to reuse.
Address

Readable wallet or contract address with truncation, copy-to-clipboard, and optional block-explorer deep link.

Learn More
ChainBadge

Compact chain indicator for network-specific instructions, examples, and warnings.

Learn More
ContractCall

Smart contract call block for ABI-backed read or write interactions, with optional interactive execution in supported contexts.

Learn More

More

Ask a question... ⌘I