A native DOM component wrapper for embedded tweets.
// Vanilla JS examplevar TwitterComponent =var tweet1 =var tweet2 =documentbodydocumentbody
$ npm install twitter-component
TwitterComponent = require('twitter-component)
TwitterComponent component class.
tweet = new TwitterComponent([opts])
Create a new instance of the twitter component.
opts is an options objec that can have the following options:
placeholder: true // Enables placeholder text while loading tweet cards
Returns a div that, when mounted into the page, will be the target of
Mounting the DOM node returned by
.render will also load
platform.twitter.com/widgets.js into the page, and any other side-effects and visitor tracking implications that script brings along with it.
Twitter employees: Please release a module version of
platform.twitter.com/widgets.js because this took 5 hours of freetime™ of just trying to get caught up with your ever changing API and widget ecosystem.