react-instagram-embed

React embedding Instagram posts component

MIT 18 个版本
安装
npm install react-instagram-embed
yarn add react-instagram-embed
pnpm add react-instagram-embed
bun add react-instagram-embed
README

react-instagram-embed

CircleCI npm version License

React embedding Instagram posts component

yarn add react-instagram-embed

# or

npm i react-instagram-embed

Live demo

Usage

import InstagramEmbed from 'react-instagram-embed';

<InstagramEmbed
  url='https://instagr.am/p/Zw9o4/'
  clientAccessToken='123|456'
  maxWidth={320}
  hideCaption={false}
  containerTagName='div'
  protocol=''
  injectScript
  onLoading={() => {}}
  onSuccess={() => {}}
  onAfterRender={() => {}}
  onFailure={() => {}}
/>

Access token is combination of App Id and Client Token. See https://developers.facebook.com/docs/instagram/oembed/#access-tokens for more details.

props

  • url {String} Instagram URL. Required
  • clientAccessToken {String} Instagram Client Access Token. Required
  • maxWidth {Number} Max width. Minimum size is 320. Default undefined
  • hideCaption {Boolean} Default false
  • containerTagName {String} Default 'div'
  • protocol {String} Instagram API script protocol. Default '' same as current protocol
    • This property needed if you use device's file system, for example, Electron, Cordova apps
  • injectScript {Boolean} Default true
  • onLoading {Function}
  • onSuccess {Function}
  • onAfterRender {Function}
  • onFailure {Function}

License

MIT

© sugarshin

版本列表
3.0.0 2021-07-10
2.0.1 2021-07-10
2.0.0 2020-11-09
1.5.0 2019-01-27
1.4.2 2019-01-10
1.4.1 2018-11-04
1.4.0 2018-06-03
1.3.4 2018-03-04
1.3.3 2018-03-02
1.3.2 2017-08-24
1.3.1 2017-06-28
1.3.0 2017-06-26
1.2.0 2017-03-04
1.1.3 2017-01-18
1.1.2 2016-11-15
1.1.1 2016-11-01
1.1.0 2016-10-23
1.0.0 2016-10-22