2.2.0 • Published 4 years ago

react-tenor v2.2.0

Weekly downloads
366
License
MIT
Repository
github
Last release
4 years ago

react-tenor

Build Status Package Version

A React component for selected GIFs from Tenor.

Getting started

First, add react-tenor to your package.json dependencies, then install using either npm install or yarn install. Then, get your API key from tenor. Finally, you can add the selector component by adding:

<Tenor token="your-token-here" onSelect={result => console.log(result)} />

Styles

To get the styles, be sure it import react-tenor/dist/styles.css into your application. You can style it appropriately for your app by overriding the CSS classes used internally. They are listed in styles.css.

Props

Below is a list of all of the props you can pass to the Tenor component.

NameTypeDefaultDescription
autoFocusbooleanfalseIndicates that the search bar of the component should request focus when it first mounts.
basestring"api.tenor.com/v1"The base of the API that this component hits.
contentFilterstring"mild"The content filter that gets passed up to tenor. See the tenor API docs for details.
contentRefRefnullA ref to the div that the Tenor component renders.
defaultResultsbooleanfalseIndicates that the component should automatically search for trending results if the search input is empty.
initialSearchstring""The starting value of the search bar.
limitnumber12The number of results to return for each search.
localestring"en_US"The locale that gets passed up to tenor. See the tenor API docs for details.
mediaFilterstring"minimal"The media filter that gets passed up to tenor. See the tenor API docs for details.
onSelectResult => voidA callback for when the user selects a GIF.
searchPlaceholderstring"Search Tenor"The placeholder that is applied to the search input field.
tokenstringThe tenor API token. See the tenor API docs for details.

Functions

The Tenor component additionally has a focus() member function that can be called to request focus be placed on the search input.

Testing locally

You can run the tests by running yarn test and lint by running yarn lint. You can run the local server by running yarn start which will start the docs server on http://localhost:8080.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/CultureHQ/react-tenor.

License

The code is available as open source under the terms of the MIT License.

2.2.0

4 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago