Identity
<Socials /> · OnchainKit
Display social links for ENS names
The Socials
component displays social media links associated with Basenames and ENS names.
It automatically fetches and renders social links stored in text records.
Features
- Name Resolution: Resolves both Basenames and ENS names to fetch associated social links
- Multiple Platform Support: Supports Twitter, GitHub, Discord, and other major platforms
- Customizable Display: Flexible styling options to match your app’s design
- Chain-Aware: Works across different EVM chains that support ENS
Usage
Basic Usage
Standalone Usage
You can also use the Socials
component independently by providing an address:
Custom Chain
Specify a different chain for ENS resolution:
Props
The Socials
component accepts the following props:
Prop | Type | Description |
---|---|---|
address | Address | null | The Ethereum address to resolve social links for |
ensName | string | Optional ENS name to resolve social links for |
chain | Chain | The chain to use for ENS resolution |
className | string | Custom CSS classes to apply to the component |
Error Handling
The component handles various edge cases:
- Returns
null
if no social links are found - Shows empty state while loading
- Gracefully handles ENS resolution errors
- Validates social links before display