Components
Address
ENS name or checksummed, truncated address, with copy and explorer link.
Shows an address the way people expect: the ENS name when there is one, otherwise 0x1234…abcd (checksummed). The full address is always available on hover and to screen readers.
0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
Installation
Section titled “Installation”npx shadcn@latest add @0xui/addresspnpm dlx shadcn@latest add @0xui/addressyarn dlx shadcn@latest add @0xui/addressbunx --bun shadcn@latest add @0xui/addressENS names resolve on Ethereum mainnet, so mainnet must be in your wagmi config. If it isn’t, or if the lookup fails, the component shows the address.
import { Address } from "@/components/address";
<Address address={address} />;Examples
Section titled “Examples”Without ENS, with explorer link
Section titled “Without ENS, with explorer link”<Address address={address} ens={false} explorer />0x71C7656EC7ab88b098defB751B7401B5f6d8976F
<Address address={address} variant="pill" />Headless
Section titled “Headless”import { useAddressName } from "@/components/address";
const { name, checksummed, isLoading } = useAddressName(address);| Prop | Type | Default | Description |
|---|---|---|---|
address |
Address |
— | Address to show. Any casing works. |
ens |
boolean |
true |
Resolve and show the ENS name. |
name |
string |
— | Name to show instead. Skips the ENS lookup. |
variant |
"inline" | "pill" |
"inline" |
Inline text or a bordered chip. |
copyable |
boolean |
true |
Show a copy button. |
explorer |
boolean |
false |
Link to the address on the current chain’s explorer. |
truncate |
{ start?: number; end?: number } |
{ start: 6, end: 4 } |
Characters kept when truncating. |
