@ukstv/jazzicon-react
Dan Finlay's Jazzicon in pure React
Last updated 4 months ago by ukstv .
MIT · Original npm · Tarball · package.json
$ cnpm install @ukstv/jazzicon-react 
SYNC missed versions from official npm registry.

Jazzicon in pure React

Reimplementation of Dan Finlay's jazzicon in pure react.

Generates inline SVG for an icon based on Ethereum address. It avoids calling document, thus suitable for server-side-generated pages, like in Next.js.

Online Demo

Installation

yarn add @ukstv/jazzicon-react

Usage

import { Jazzicon } from '@ukstv/jazzicon-react';

export default function() {
  return (
    <div style={{ width: '100px', height: '100px' }}>
      <Jazzicon address={'0xBAc675C310721717Cd4A37F6cbeA1F081b1C2a07'} />
    </div>
  );
}

Remember to wrap Jazzicon component into something with desired width and height, as the component fills 100% of the enclosing component.

Alternatively, you could modify appearance via styled-components or emotion:

import { Jazzicon } from '@ukstv/jazzicon-react';
import styled from '@emotion/styled';
const ModifiedJazzicon = styled(Jazzicon)({
  width: 100,
  height: 100,
});
export default function Icon() {
  return (
    <ModifiedJazzicon address={'0xBAc675C310721717Cd4A37F6cbeA1F081b1C2a07'} />
  );
}

Current Tags

  • 1.0.0                                ...           latest (4 months ago)

6 Versions

  • 1.0.0                                ...           4 months ago
  • 1.0.0-a.4                                ...           4 months ago
  • 1.0.0-a.3                                ...           4 months ago
  • 1.0.0-a.2                                ...           4 months ago
  • 1.0.0-a.1                                ...           4 months ago
  • 1.0.0-a.0                                ...           4 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (22)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |