UX.SOL

Component

Address Display

Displays a shortened blockchain address with optional copy-to-clipboard support.

Preview

UxSo…1111

Installation

terminal
$npx shadcn@latest add https://uxdotsol.xyz/r/address-display.json

Usage

address-display.tsx
import { AddressDisplay } from "@/components/uxdotsol/components/address-display";
 
export default function App() {
return (
<>
<AddressDisplay address="UxSol1111111111111111111111111111111111111" />
<AddressDisplay address="UxSol1111111111111111111111111111111111111" variant="hover-actions" actions={["copy", "explorer", "more"]} />
</>
);
}

Props / Arguments

NameTypeDefaultDescription
variant"default" | "hover-actions""default"Default keeps the address and copy icon visible. Hover actions reveals the expandable action surface on hover, focus, or tap.
addressstringrequiredThe full on-chain address string to display (e.g. a base-58 public key).
truncatebooleantrueWhen true, addresses longer than 10 characters are shortened to AAAA...ZZZZ format.
copyablebooleantrueWhen true, the address and copy action copy the full value and show a brief confirmation icon.
actions("copy" | "explorer" | "more")[]["copy", "explorer", "more"]Only applies to variant="hover-actions". Controls the capsule actions; defaults to no actions when copyable is false.
cluster"mainnet-beta" | "devnet" | "testnet""mainnet-beta"Sets the Solana cluster query used by explorer links.
explorer / explorerUrl"explorer" | "solscan" / string"explorer" / undefinedSelects Solana Explorer or Solscan, or supplies a custom explorer base URL.