Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

blockies-react-svg

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blockies-react-svg

Blockies react svg function component, blocky identicons, address-unique Ethereum avatar, svg base64 url.

  • 0.0.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
550
decreased by-72.26%
Maintainers
1
Weekly downloads
 
Created
Source

blockies-react-svg

Blockies react svg function component, blocky identicons, address-unique Ethereum avatar, svg base64 url.

You can have responsive width and height without rerendering because of SVG properties. meanwhile, it will store the result.

You also can use base64 url, it is smaller(3kb) than ethereum-blockies-base64(16kb).

(the address will auto toLowerCase until set caseSensitive property)

Installation

$ npm i blockies-react-svg

Use react fc:

import BlockiesSvg from 'blockies-react-svg'
// or use tsx directly:
// import BlockiesSvg from 'blockies-react-svg/src/BlockiesSvg.tsx'

<BlockiesSvg 
  address={address}
  className='classname'
  style={styles} 
  />

Use react sync component:

import BlockiesSvgSync from 'blockies-react-svg/dist/es/BlockiesSvgSync.js'
// or use tsx directly:
// import BlockiesSvgSync from 'blockies-react-svg/src/BlockiesSvgSync.tsx'

<BlockiesSvgSync 
  address={address} 
  className='classname'
  style={styles} 
  />

Use base64 url:

import makeBlockiesUrl from 'blockies-react-svg/dist/es/makeBlockiesUrl.js'
// or use ts directly:
// import makeBlockiesUrl from 'blockies-react-svg/src/makeBlockiesUrl.ts'

<img src={makeBlockiesUrl(address)} />

Why SVG?

Canvas render doesn't support arbitrary size or other customized styles.

SVG is the better experience.

SVG base64 url size is smaller than canvas.

Keywords

FAQs

Package last updated on 08 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc