Hash

Compact middle-truncated display for addresses and hashes.

Demo

Address
0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
Transaction hash
0xa1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2
Contract
0x4200000000000000000000000000000000000006

Format helper

import { formatHash } from 'regen-ui'

formatHash('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045')
// "0xd8dA…6045"

Usage

import { Hash } from 'regen-ui'

export function AddressLabel() {
  return <Hash copy value="0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" />
}

API Reference

Hash.Props

copyOptional
Typeboolean
Defaultfalse
Show an inline copy button after the hash.
minOptional
Typenumber
Default4
Minimum number of body characters to keep visible on each side.
valueRequired
Typestring
DefaultNone
Hash or address value to display.
Inherits HTMLAttributes<HTMLSpanElement>, except children.