Account Info

A component that dislpays information about the identity of a supplied ss58 address

Introduction

AccountInfo displays identity details for a given ss58 address. It shows a concise summary (name + truncated address) with optional avatar/identicon and a verified badge. On hover or click it reveals richer details (legal name, socials, email, matrix, etc.) and includes a one-click copy action.

Features

  • summary view: name or truncated address with optional verified badge
  • avatar/identicon: shows on-chain image if present, otherwise a deterministic identicon
  • details popover/hover: configurable fields (display, legal, socials, email, matrix, verified)
  • copy to clipboard: accessible copy button for the full address
  • configurable truncation: control or disable address truncation
  • themes: identicon themes: polkadot, substrate, beachball, jdenticon
  • skeleton state: graceful loading placeholder
  • adapter friendly: base component uses injected services; dedot wrapper wires data for you

Installation

npx polkadot-ui@latest add account-info

The Account Info component additionally depends on tanstack react-query to fetch data. So you will need to wrap your app in a QueryClientProvider.

import { QueryClient, QueryClientProvider } from "@tanstack/react-query"

const queryClient = new QueryClient()

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return <QueryClientProvider client={queryClient}>
    //... 
  </QueryClientProvider>
}

Usage

// import the dedot or papi version of the component
import { AccountInfo } from "@/registry/polkadot-ui/blocks/account-info/account-info.dedot"

export default function Example() {
  return (
    <div className="space-y-6">
      <AccountInfo address="5F3sa2TJAWMqDhXG6jhV4N8ko9xE2Z4sQYDPoV8eP2eK7x7Y" />
    </div>
  )
}

Props

The AccountInfo wrapper exposes the base props minus services (it injects data from dedot).

PropTypeDefaultDescription
addressstringss58 address to display.
chainIdstringprovider defaultOptional chain for identity lookup.
showIconbooleantrueShow avatar/identicon in summary/details.
iconTheme"polkadot" | "substrate" | "beachball" | "jdenticon""polkadot"Identicon theme when no image is present.
fieldsArray<AccountInfoField> | "all""all"Which identity fields to show in details.
truncatenumber | boolean6If number, truncates address to that many chars per side; false disables truncation.
componentType"popover" | "hover""hover"Details UI: click-to-open popover or hover card.
classNamestringTailwind classes applied to the summary wrapper.

Identity fields you can include in fields:

type AccountInfoField =
  | "display"
  | "legal"
  | "email"
  | "twitter"
  | "github"
  | "discord"
  | "matrix"
  | "image"
  | "verified"

Notes:

  • The AccountInfoBase also accepts a services prop ({ identity, isLoading, error }) used by adapters. You do not need to provide it when using the AccountInfo/AccountInfoWithProvider wrappers.
  • A loading skeleton is available as AccountInfoSkeleton.

Examples

Account Info
Display identity name and optional fields for an address
1dsrQj...4pTUh21dsrQj...4pTUh2
Account Info - Select Fields
Select which fields to display in the popover and by default. You can also change the order of the fields.
5CwW67...Kwd9R25CwW67...Kwd9R2
Account Info - Hover Card
Display the account info in a hover card
1hFmn2...7qgmpA1hFmn2...7qgmpA
Account Info - Popover Card
Display the account info in a popover card that opens on click
1hFmn2...7qgmpA1hFmn2...7qgmpA
Account Info - Identicon Theme
This Address input accepts SS58 as well as eth address format
1hFmn2...7qgmpA1hFmn2...7qgmpA