Skip to main content

Address

Display an address with a copy-to-clipboard button and a visual blockie representation. The component offers the following features:

  • Shows a shortened or full address format
  • Provides a clickable link to the block explorer (can be disabled)
  • Displays a blockie image unique to the address
  • Includes a copy button for easy address copying. It is a real <button> with an accessible label ("Copy address", then "Address copied" briefly after copying), so it works with keyboard and screen readers

When clicked, the address links to:

  1. The block explorer of the connected wallet's network (if a wallet is connected)
  2. The block explorer of the first network in targetNetworks (if no wallet is connected)

This component is useful for displaying user addresses, contract addresses, or any Aptos address in a user-friendly manner.

Usage​

import { Address } from "~~/components/scaffold-move";
import { useWallet } from "@aptos-labs/wallet-adapter-react";

const { account: connectedAccount } = useWallet();
<Address address={connectedAccount?.address} />

Parameter​

ParameterTypeDefault ValueDescription
addressstringundefinedAptos address in 0x___ format.
disableAddressLink (optional)booleanfalseIf true, disables the block explorer link when clicking on the address.
format (optional)string"short"Display format of the address. "short" shows first five characters, "long" shows the entire address.
size (optional)string"base"Size of the Address component. Options: "xs", "sm", "base", "lg", "xl", "2xl", "3xl". base is default.