react-gif-picker
v1.0.0
Published
A react gif picker using giphy API
Downloads
88
Maintainers
Readme
react-giphy-picker
react-giphy-picker is a simple gif picker component using giphy API
On select it returns a Gif object in the format specified for an image from Giphy's search API giphy sample-response-search
Install
npm install react-giphy-picker --save
Usage basic
import Picker from 'react-giphy-picker'
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')
)
Props
onSelected
(required)
Handler returns the emoji character selected from the emoji picker.
visible
Opacity to show or hide the picker. Defaults to true
.
modal
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
.
Styles
Uses styled-components 💅 for the base styling.
Development
npm install
npm run build
npm test
npm start