@digitalungdom/bot-identicon
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

@digitalungdom/bot-identicon

Bot Identicon

A React component that deterministically generates robot icons based on the given input. See example code below.

Made with create-react-library

NPM JavaScript Style Guide

Install

npm install --save @digitalungdom/bot-identicon

Usage

import React, { Component } from 'react'

import HashedBotIdenticon from '@digitalungdom/bot-identicon'

class Example extends Component {
  render() {
    return <HashedBotIdenticon identifier='john von neumann' size={500} />
  }
}

Props

BaseBotIdenticonProps

Name Type Default Description
size 'inherit' | number 200 size of the icon
background boolean false display background

BotIdenticonProps

Inherits BaseBotIdenticonProps.

Name Type Default Description
color [h: number, s: number, l: number] [216, 81, 51] color in HSL-values
face Face normal face of the identicon

<HashedBotIdenticon>

Inherits props for BotIdenticonProps. To override the hashed values, one can provide a face and/or color property.

  • identifier - string that will deterministically create colors and a face with md5

Face

One of the following values

  • 'cool'
  • 'evil'
  • 'kiss'
  • 'incognito'
  • 'normal'
  • 'laughing'
  • 'happyEyes'
  • 'heartEyes'
  • 'celebrate'

Dependencies

Crypto-js is needed to hash the identifier.

Credit

The original robot design is by @charlesmaddock and @digitalungdom-se. The code for this repo was originally developed by @adelhult. The transitition to TypeScript and publishing as a reusable component was made by @nautman.

License

MIT © digitalungdom-se

Readme

Keywords

none

Package Sidebar

Install

npm i @digitalungdom/bot-identicon

Weekly Downloads

44

Version

1.1.2

License

MIT

Unpacked Size

119 kB

Total Files

14

Last publish

Collaborators

  • kelszo
  • digitalungdom-se