Skip to content
This repository has been archived by the owner on May 15, 2019. It is now read-only.

polkadot-js/polkadot-identicon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

polkadot-identicon

A Polkadot-themed SS58 identicon

usage

To install the component, do npm install --save polkadot-identicon

Inside a React component, you can now render any Polkadot account with the associated icon -

import Identicon from 'polkadot-identicon';

...
render () {
	// address is either string (ss58-encoded address) or Uint8Array (publicKey)
	const { address } = this.props;
	// size is a number, indicating the size (in pixels)
	const size = 32;

	return (
		<Identicon
			className='my-class'
			id={address}
			size={size}
		/>
	);
}
...