Skip to content

Address Component

The Address component displays Ethereum addresses with automatic ENS resolution, avatar display, and block explorer linking.

Import

import { Address } from "@scaffold-ui/components";

Props

PropTypeDefaultDescription
addressAddress-The Ethereum address to display
disableAddressLinkbooleanfalseDisable linking to block explorer
format"short" | "long""short"Display format for the address
size"xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl""base"Size of the component
onlyEnsOrAddressbooleanfalseShow only ENS name or address (not both)
chainChainFirst chain from WagmiProvider config or mainnetBlockchain network for resolution
styleCSSProperties-Custom CSS styles (memoize to prevent re-renders)

Live Examples

Basic Usage

0xd8da6bf26964af9d7eed9e03e53415d37aa96045 avatar
import React from "react";
import { Address } from "@scaffold-ui/components";
 
<Address address="0xd8da6bf26964af9d7eed9e03e53415d37aa96045" />;

Different Sizes

0xd8da6bf26964af9d7eed9e03e53415d37aa96045 avatar
0xd8da6bf26964af9d7eed9e03e53415d37aa96045 avatar
import React from "react";
import { Address } from "@scaffold-ui/components";
 
<Address
  address="0xd8da6bf26964af9d7eed9e03e53415d37aa96045"
  size="sm"
/>;
 
<Address
  address="0xd8da6bf26964af9d7eed9e03e53415d37aa96045"
  size="xl"
/>;

Long Format

import React from "react";
import { Address } from "@scaffold-ui/components";
 
<Address
  address="0x1234567890123456789012345678901234567890"
  format="long"
/>;

Disable Block Explorer Link

0xd8da6bf26964af9d7eed9e03e53415d37aa96045 avatar
0xd8dA...6045
import React from "react";
import { Address } from "@scaffold-ui/components";
 
<Address
  address="0x1234567890123456789012345678901234567890"
  disableAddressLink={true}
/>;

ENS or Address Only

import React from "react";
import { Address } from "@scaffold-ui/components";
 
<Address
  address="0xd8da6bf26964af9d7eed9e03e53415d37aa96045"
  onlyEnsOrAddress={true}
/>;

Custom Chain

0x1234567890123456789012345678901234567890 avatar
import React from "react";
import { polygon } from "viem/chains";
import { Address } from "@scaffold-ui/components";
 
<Address
  address="0x1234567890123456789012345678901234567890"
  chain={polygon}
/>;

Invalid Address Handling

When an invalid Ethereum address is provided, the component displays an error message with "Invalid address" text.

Invalid address0xInvalidAddress123
import React from "react";
import { Address } from "@scaffold-ui/components";
 
// Invalid address - shows error message
<Address address="0xInvalidAddress123" />;