Skip to content

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
Terminal window
npx shadcn@latest add @0xui/address

ENS 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} />;
<Address address={address} ens={false} explorer />
0x71C7656EC7ab88b098defB751B7401B5f6d8976F
<Address address={address} variant="pill" />
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.