1.0.9 • Published 5 years ago

react-robohash v1.0.9

Weekly downloads
44
License
MIT
Repository
-
Last release
5 years ago

logo

npm version Build Status Blazing Fast Coverage Status License: MIT gzip size Known Vulnerabilities

Install

npm install react-robohash --save
# or
yarn add react-robohash

Playground

You can play around with the module on codesandbox

Props

NameTypeRequiredDefaultDescription
namestringtruename, email, whatever identifier you want
altstringfalseRobohash-${name}alt property for image
classNamestringfalseRobohashpass custom class
sizestringnumberfalsespecify image size like 200 or 100x50 (square works best)
typestringnumberfalserobottype - "robot", "alien", "head", "cat", 1, 2, 3, 4
backgroundstringfalse0custom background set (1, 2)
fileTypestringfalsepngimage return type, png, svg, jpg (see homepage)
gravatarbooleanfalsefalsechecks if gravatar is available otherwise fallbacks to robot
childrenfunctionfalsecustom render prop function which gets only the url passed in (see example)

Usage

import Robohash from 'react-robohash';

<Robohash
  name="foxy"
  type="cat"
/>

or with custom element as render prop function

import Robohash from 'react-robohash';

<Robohash name="react-robohash">
  {url => <span>{url}</span>}
</Robohash>

Author

Support

If you like the project and want to support my work, you can think about buy me a coffee :)

paypal

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago