A simple gif picker component for React using GIPHY API
NPM -
npm i react-giphy-component --save
Yarn -
yarn add react-giphy-component
import Picker from 'react-giphy-component'
import ReactDOM from 'react-dom'
import React, { Component, PropTypes } from 'react'
class TestComponent extends Component {
log (gif) {
console.log(gif)
}
render () {
return (
<div>
<Picker onSelected={this.log.bind(this)} />
</div>
)
}
}
ReactDOM.render(
<TestComponent />,
document.getElementById('root')
)
Handler returns the GIF selected from the picker. On select it returns a Gif object in the format specified for an image from Giphy's search API giphy sample-response-search
Opacity to show or hide the picker. Defaults to true
.
If you want the emoji picker to be a modal.
true
will set the wrapper as position: absolute
.
Or false
, which is the default will be position: static
.
GIPHY API key, you can get one from https://developers.giphy.com/
A custom loader react component that will be showing while performing API calls
Input plave holder text
Placeholder background color while rendering GIF images
CSS class name for GIPHY wrapper
CSS class name for seach keyword input
CSS class name for GIF image
Child react components
Uses styled-components 💅 for the base styling.
npm install
npm run build
npm test
npm start