JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15694
  • Score
    100M100P100Q149703F
  • License MIT

Twitter widgets as React components

Package Exports

  • react-twitter-widgets
  • react-twitter-widgets/dist/components/Timeline

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 (react-twitter-widgets) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-twitter-widgets

Alleviates the need for Twitter's default 2008-style widget snippets.

Available widgets: Timeline, Share, Follow, Hashtag, Mention, Tweet.

See below for usage.

Installation

npm install --save react-twitter-widgets

Example

import { Timeline } from 'react-twitter-widgets'
// var Timeline = require('react-twitter-widgets').Timeline

ReactDOM.render((
  <Timeline
    widgetId={'29838471883830183'}
    options={{
      username: 'TwitterDev',
      height: '400'
    }}
  />
), document.getElementById('root'))

Usage

Available widgets: Timeline, Share, Follow, Hashtag, Mention, Tweet

All widgets take an optional options object prop. To learn more about the available options (height, width, align, count, etc), see this link.

Timeline requires the widget id supplied by Twitter as widgetId (ex. '123456'). Also, note that you can override your configured screen name with a custom screenName (username) in the options object.

Share requires a url prop.

Follow and Mention require a username prop.

Hashtag requires a tag prop.

Tweet requires a tweetId prop. Ex. '511181794914627584'

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

Credits

License

MIT