1.1.2 • Published 3 years ago

@digitalungdom/bot-identicon v1.1.2

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years ago

@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

NameTypeDefaultDescription
size'inherit' \| number200size of the icon
backgroundbooleanfalsedisplay background

BotIdenticonProps

Inherits BaseBotIdenticonProps.

NameTypeDefaultDescription
color[h: number, s: number, l: number][216, 81, 51]color in HSL-values
faceFacenormalface 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

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago