Skip to content

A react component that renders animated pokemon sprites.

License

Notifications You must be signed in to change notification settings

anshumanv/react-poke-sprites

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lugia

react-poke-sprites


A react component that renders animated pokemon sprites

Installation

Install the npm module in your app directory.

npm i react-poke-sprites

OR

yarn add react-poke-sprites

Usage

  • With a given pokémon name (case insensitive)
import PokeSprite from 'react-poke-sprites'

<PokeSprite pokemon={'Lugia'} className="pokemon-class" /> // passes this className to the rendered sprite
  • With a given pokémon id (make sure the ID is valid) You may refer this link to get id's of all pokémons.
import PokeSprite from 'react-poke-sprites'

<PokeSprite pokemon={249} className="pokemon-class" /> // passes this className to the rendered sprite

Props

  • pokemon - Pass the name or the ID of the pokemon.

  • className - Pass in a class name to modify as you see fit.

Related

  • A corresponding Vue.js component is here.

Credits

  • Uses pokemon-gif to retrieve links from Pokestadium.
  • There's already a component for this here but it wasn't working in my case so I decided to create my own.

Author

Anshuman Verma

Contribute

Found a bug, please create an issue

License

license

© Anshuman Verma

About

A react component that renders animated pokemon sprites.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published