JSPM

  • Created
  • Published
  • Downloads 67
  • Score
    100M100P100Q65724F
  • License ISC

Handy React components for www.opengraph.io

Package Exports

  • opengraph-react

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (opengraph-react) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Opengraph-react

Opengraph react is a set of handy react components for displaying site previews with the information gathered by https://opengraph.io.

Installation

Simply install using npm:

npm install --save opengraph-react

Usage

<OpengraphReactComponent  
  site={'site that you want to load (url encoding is done for you)'}  
  appId={Your opengraph.io api key goes here}  
  loader={A component to display while results are being fetched}  
  size={'small'}    
/>

Props

name type description
site string Website that you want to load uri encoding is done for you so no need to encode it
appId string Your ApiKey for opengraph.io (you can get one at www.opengraph.io)
loader(optional) component A component to display while loading (ex a spinner) won't display anything by default
size enum Either small or large. Tells it what kind of card to display
onlyFetch boolean If this prop is supplied then no card will display, but instead the results from opengraph will be passed as props to the components children
acceptLang string accept lang header for request, defaults to "auto"
useProxy boolean Tells opengraph whether or not to use a proxy (defaults to false)
forceCacheUpdate boolean If this is supplied opengraph will not reply with cached result (defaults to false)
fullRender boolean If this is supplied then opengraph will use its full page render feature (defaults to false)