TokenChip

A compact component for displaying token information with optional chain icon and copy functionality.

TokenChip

The TokenChip component provides a compact way to display token information, including token icon, name, symbol, and optional chain information.

Usage

import { TokenChip } from '@avalabs/builderkit';
 
// Basic usage
<TokenChip 
  chain_id={43114}
  address="0x1234567890123456789012345678901234567890"
  symbol="AVAX"
  name="Avalanche"
/>
 
// With chain icon and copy functionality
<TokenChip 
  chain_id={43114}
  address="0x1234567890123456789012345678901234567890"
  symbol="AVAX"
  name="Avalanche"
  showChainIcon={true}
  allowCopyToClipboard={true}
/>

Props

PropTypeDefaultDescription
chain_idnumber-Chain ID of the token
addressstring-Token contract address
symbolstring-Token symbol
namestring-Token name (optional)
showChainIconbooleanfalseWhether to show chain icon alongside token icon
showNamebooleantrueWhether to show token name (if false, shows only symbol)
allowCopyToClipboardbooleanfalseEnable copy address to clipboard functionality
classNamestring-Additional CSS classes

Features

  • Displays token icon with optional chain icon
  • Shows token name and/or symbol
  • Copy to clipboard functionality with visual feedback
  • Flexible layout options
  • Tailwind CSS styling support

Examples

Basic Token Display

<TokenChip 
  chain_id={43114}
  address="0x1234567890123456789012345678901234567890"
  symbol="AVAX"
  name="Avalanche"
/>

With Chain Icon

<TokenChip 
  chain_id={43114}
  address="0x1234567890123456789012345678901234567890"
  symbol="AVAX"
  name="Avalanche"
  showChainIcon={true}
/>

Symbol Only

<TokenChip 
  chain_id={43114}
  address="0x1234567890123456789012345678901234567890"
  symbol="AVAX"
  name="Avalanche"
  showName={false}
/>

With Copy Functionality

<TokenChip 
  chain_id={43114}
  address="0x1234567890123456789012345678901234567890"
  symbol="AVAX"
  name="Avalanche"
  allowCopyToClipboard={true}
/>

Custom Styling

<TokenChip 
  chain_id={43114}
  address="0x1234567890123456789012345678901234567890"
  symbol="AVAX"
  name="Avalanche"
  className="bg-gray-100 rounded-lg p-2"
/>

Visual States

  1. Default: Shows token information with icon
  2. Copy Button: Shows copy icon when allowCopyToClipboard is true
  3. Copy Confirmation: Shows check icon briefly after copying
  4. Chain Display: Shows chain icon when showChainIcon is true

Is this guide helpful?

On this page

Privacy Policy

We respect your privacy and are committed to protecting your personal data. This privacy policy will inform you about how we look after your personal data and tell you about your privacy rights.

Read full policy