Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-google-books

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-google-books

A React Native component for browsing google books

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-50%
Maintainers
3
Weekly downloads
 
Created
Source

react-native-google-books

npm version

A React Native component for browsing google books

         

Compatibility

    

This react native component is purely written in Javascript and it works in both iOS and Android platforms.

Demo

Prerequisites

Get the API key from Google Developer Console. https://console.developers.google.com

Generate the API key and enable the Google Books API

Usage

import {GoogleBookSearch} from 'react-native-google-books';

Basic usage of GoogleBookSearch

  <GoogleBookSearch
     apikey={"API KEY FROM DEVELOPER CONSOLE"}
     onResultPress={(book)=> console.log(book)}
  />

onResultPress will give you the pressed book details.

     {
           id:'id of book',
           title:'name of the book',
           authors:['array of authors'],
           isbn:['isbn types'],
           raw:{}
      }

You can use this as an API also,

import {BookSearch} from 'react-native-google-books';
  async getGameofThronesBooks(){
    let books = await BookSearch.searchbook("game of thrones","API_KEY");
  }
  //Response of this request
  {
    status:true,
    code:200,
    data:[{}]
  }

Props Available

PropertyTypeDefaultRequiredDescription
apikeystringnullYESAPI Key from Google Developer Console. But the search works without API key also for a limited quota
onResultPressGet the pressed result as callback
searchResultGet the raw search result as callback
placeholderstringSearchNOPlaceholder text for search box
valuestringNOOnly if you want to preload any value in search
searchContainerStyleobjectNOPass the style for the search box (container)
searchInputStyleobjectNOPass the style for the TextInput
resultContainerStyleobjectNOPass the style for the search result row container
resultItemStyleobjectNOPass the style for the search result text
intervalnumber800NOThis is a typing timer. When you stop typing for 800 ms, it will fetch the results
limitnumber10NOLimit the number of search results

All Props Usage

<GoogleBookSearch                    
    apikey={"API KEY"}
    value={"harry potter"}
    searchContainerStyle={{marginTop:32}}
    searchInputStyle={{fontSize:16}}
    resultContainerStyle={{padding:4}}
    resultItemStyle={{color:'blue'}}
    interval={300}
    searchResult={(result) => console.log(result)}                    
    onResultPress={(book)=> console.log(book)} 
/>

Keywords

FAQs

Package last updated on 13 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc