react-robohash
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

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

Name Type Required Default Description
name string true name, email, whatever identifier you want
alt string false Robohash-${name} alt property for image
className string false Robohash pass custom class
size string number false
type string number false robot
background string false 0 custom background set (1, 2)
fileType string false png image return type, png, svg, jpg (see homepage)
gravatar boolean false false checks if gravatar is available otherwise fallbacks to robot
children function false custom 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

Package Sidebar

Install

npm i react-robohash

Weekly Downloads

2

Version

1.0.9

License

MIT

Unpacked Size

10.8 kB

Total Files

6

Last publish

Collaborators

  • felixwostal