Skip to main content
The IdentityCard component provides a comprehensive way to display user identity information, including ENS names, avatars, and chain-specific name resolution.

Features

  • Name Resolution: Resolves both Basenames and ENS names automatically
  • Avatar Support: Displays ENS and chain-specific avatars
  • Flexible Display: Customizable layout and styling options
  • Chain-Aware: Works across different EVM chains that support name resolution
  • Tooltip Support: Displays attestation information on badge hover

Usage

Basic Usage

Badge Tooltip

You can enable a tooltip for the attestation badge to provide context about what the badge represents:
You can also provide custom tooltip text:

Customization

You can override styles using className or by setting a custom OnchainKit theme. You can also set the mainnet chain for ENS name resolution:

Props

IdentityCardReact

Error Handling

The component handles various error states gracefully:
  • Invalid addresses display a shortened address format
  • Missing ENS names fallback to shortened addresses
  • Failed avatar fetches show a default avatar
  • Network errors maintain a degraded but functional display

Best Practices

  1. Always provide a valid chain object from viem/chains
  2. Handle loading states in parent components when address might be undefined
  3. Implement proper error boundaries in parent components
  4. Consider mobile responsiveness when styling
  5. Use badgeTooltip to provide context about what the verification badge represents