1.1.1 • Published 1 year ago

react-gif-picker-control v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Gif Picker React Control

demo

A React component that offers a GIF picker control with a GIF search engine powered by Tenor API V2.

Before using

You need to provide a Tenor API V2 key in order to use this component. You can obtain a key from here.

Installation

npm install gif-picker-react

or

yarn add gif-picker-react

Usage

import { GifPicker } from "react-gif-picker-control";

const App = () => {
    return (
        <div>
            <GifPicker
                tenorApiKey={"YOUR_API_KEY"}
                onGifClick={"YOUR_FUNCTION_TO_HANDLE_THE_GIF_SELECTION"}
            />
        </div>
    );
};

Props

Required

PropTypeDescription
tenorApiKeystringYour Tenor API key for powering the GIF search engine
onGifClickfunctionCallback function triggered when a GIF is clicked. The function has one parameter which is Gif object

Optional

PropertyTypeDefault valueDescription
searchLimitnumber50Define the limit for search results
hideCategoriesbooleanfalseHide or show GIF categories in the picker
autoFocusbooleantrueAuto-focus on the GIF search input

Styling

PropertyTypeDefault valueDescription
colorsColorPalette{ primary: '#424242', accent: '#FFA25F', background: '#676767', text: '#FFF' }Customize the color palette of the GIF picker
widthnumber350Set custom width for the GIF picker container
heightnumber450Set custom height for the GIF picker container

Images

PropertyTypeDefault valueDescription
imageErrorUrlstringThe SimpsonsImage src for displaying GIF error state
imageNoResultsUrlstringSouth ParkImage src for displaying no results state

Gif

PropertyTypeDescription
idstringTenor result ID
descriptionstringA brief description associated with the GIF
urlPreviewstringThe URL of a thumbnail for the GIF
urlMediastringThe URL of the actual GIF media file
widthnumberThe width of the GIF in pixels
heightnumberThe height of the GIF in pixels
createdAtDateThe date when the GIF was created or added

Other screens

Error

error

No results

no-results

1.1.1

1 year ago

1.1.0

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago