A responsive & React-based auto-suggest search box for Youtube apps
npm install react-youtube-autocompleteI like to build apps on top of Youtube. Sometimes you need to let users search for videos on Youtube within your app.
Just drop this component into your Youtube-friendly React.js app and you'll get a fully functional auto-suggest-enabled search box.
See this compenent in action
npm install --save react-youtube-autocomplete
- Autocomplete text entry
- Search Youtube based on text input
- Retrieve list of results from Youtube
- Display drop-down list of search results
``js`
maxResults={string} // defaults -> 50. Number of video search results you want
placeHolder={string} // defaults -> "Search Youtube"
callback={function} // callback to execute when search results are retrieved
className={string} // defaults -> random string
/>
`js
import YoutubeAutocomplete from 'react-youtube-autocomplete';
class Example extends React.Component {
render() {
return (
placeHolder="Search Youtube"
callback= this._onSearchResultsFound
/>
);
}
_onSearchResultsFound(results) {
// Results is an array of retreived search results
// I use flux, so I dispatch results to an action
flux.actions.showSearchResults(results);
}
}
``
MIT
Are you looking to build a professional app for the Web using React & Redux?
Check out my course "How to Write a Single Page Application".
www.singlepageapplication.com