Skip to main content

BlockieAvatar

Show a blockie (bar code profile icon) component for a given public address.

The autogenerated blockie can be manually replaced by another image that we pass through the ensImage prop.

BlockieAvatar Example

If you want more control over styling the blockie, you can directly use blo (pre-installed in Scaffold-ETH 2) and internally used by BlockieAvatar component to get the image URL.

Importโ€‹

import { BlockieAvatar } from "~~/components/scaffold-eth";

Usageโ€‹

<BlockieAvatar address="0x34aA3F359A9D614239015126635CE7732c18fDF3" size={24} />

Propsโ€‹

PropTypeDefault ValueDescription
addressstringundefinedThe address for which you want to display its blockie. Ensure it's in the 0x___ format.
sizenumberundefinedWidth and Height in pixels (square).
ensImage (optional)stringundefinedAn arbitrary image url to render instead of the blockie.