# react-identicons

> Identicon component for React

Latest version **1.2.5** (published 2021-01-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-identicons
pnpm add react-identicons
yarn add react-identicons
bun add react-identicons
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.5 |
| Published | 2021-01-23 |
| First published | 2018-11-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 32 |
| Author | Tuhnik |
| Maintainers | tuhnik |
| Keywords | identicon, react, component |

## Links

- npm: https://www.npmjs.com/package/react-identicons
- Repository: https://github.com/tuhnik/react-identicons
- Homepage: http://tuhnik.github.io/react-identicons
- Issues: https://github.com/tuhnik/react-identicons/issues
- npm.io page: https://npm.io/package/react-identicons

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.2.5 (latest) — 2021-01-23
- 1.2.4 — 2020-03-20
- 1.2.3 — 2020-03-20
- 1.2.2 — 2020-03-19
- 1.2.1 — 2020-03-19
- 1.2.0 — 2020-03-19
- 1.1.7 — 2018-11-08
- 1.1.6 — 2018-11-05
- 1.1.5 — 2018-11-04
- 1.1.4 — 2018-11-04
- 1.1.3 — 2018-11-04
- 1.1.2 — 2018-11-04
- 1.1.1 — 2018-11-04
- 1.1.0 — 2018-11-04
- 1.0.9 — 2018-11-04
- … 9 more at https://npm.io/package/react-identicons/versions

## README

<h1 align="center">react-identicons</h1>
<div align="center">
  <strong>React component for generating and displaying github-style identicons.</strong>
</div>
</br>
<div align="center">
  <a href="https://www.npmjs.com/package/react-identicons"><img src="https://img.shields.io/bundlephobia/min/react-identicons.svg"/></a>
  <a href="https://www.npmjs.com/package/react-identicons"><img src="https://img.shields.io/npm/v/react-identicons.svg"/></a>
  <a href="https://www.npmjs.com/package/react-identicons"><img src="https://img.shields.io/npm/l/react-identicons.svg"/></a>
</div>

## Live demo

[tuhnik.github.io/identicon-live (old)](https://tuhnik.github.io/identicon-live/)

[tuhnik.github.io/react-identicons (storybook)](https://tuhnik.github.io/react-identicons/)

## Setup

```bash
npm install react-identicons --save
```

## Basic usage

```javascript
import React from 'react';
import Identicon from 'react-identicons';

const App = () => {
  return <Identicon string="randomness" />;
};
export default App;
```

Code above should result in the following identicon:

![Identicon](https://github.com/tuhnik/react-identicons/blob/master/img/identicon.png?raw=true)

## Props

> Note: all color values should use hexadecimal notation (i.e. #ebebeb)

- `string`: (String) Value used for identicon pattern generation.
- `size`: (Number) Single number to represent width and height of identicon image. Defaults to 400.
- `padding` (Number) Padding around blocks. Defaults to 0.
- `bg` (String) Override color for background blocks. Transparent by default.
- `fg` (String) Override color for foreground blocks. Generated randomly from hash by default.
- `palette` (Array) Provide an array of colors to be used as foreground block colors.
- `count` (Number) Block count, can't be higher than 5. Useful for generating smaller (i.e. 3x3 identicons).
- `getColor` (Function) Callback function which returns current foreground color value.

---
_Source: https://npm.io/package/react-identicons · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
