{"library":"react-twitter-embed","title":"React Twitter Embed Components","description":"react-twitter-embed is a JavaScript library providing a straightforward way to integrate various Twitter widgets (such as timelines, individual tweets, share buttons, follow buttons, and video embeds) into React applications. It acts as a wrapper around the official Twitter Widgets API, handling the asynchronous loading and rendering of Twitter's external scripts. The current stable version is 4.0.4. While release cadence isn't strictly predictable, the project has seen consistent updates addressing issues, adding new widget types, and ensuring compatibility with newer React versions. Its key differentiator is simplicity, abstracting away the complexities of the Twitter Widgets JavaScript API into declarative React components, making it easier to embed dynamic Twitter content without manual script management.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install react-twitter-embed"],"cli":null},"imports":["import { TwitterTimelineEmbed } from 'react-twitter-embed';","import { TwitterTweetEmbed } from 'react-twitter-embed';","import { TwitterShareButton } from 'react-twitter-embed';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport { \n  TwitterTimelineEmbed, \n  TwitterTweetEmbed, \n  TwitterShareButton, \n  TwitterFollowButton \n} from 'react-twitter-embed';\n\nfunction App() {\n  return (\n    <div style={{ display: 'flex', flexDirection: 'column', gap: '20px', padding: '20px' }}>\n      <h1>My Twitter Embeds</h1>\n\n      <h2>Recent Tweets (Timeline)</h2>\n      <TwitterTimelineEmbed\n        sourceType=\"profile\"\n        screenName=\"reactjs\"\n        options={{ height: 400 }}\n      />\n\n      <h2>Featured Tweet</h2>\n      <TwitterTweetEmbed\n        tweetId={'1567341851213031424'} // Example tweet ID for ReactJS\n      />\n\n      <h2>Share on Twitter</h2>\n      <TwitterShareButton\n        url={'https://react.dev'}\n        options={{ text: 'Check out the new React docs!', via: 'reactjs' }}\n      />\n\n      <h2>Follow ReactJS</h2>\n      <TwitterFollowButton\n        screenName={'reactjs'}\n      />\n    </div>\n  );\n}\n\nconst root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);\nroot.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>\n);","lang":"typescript","description":"This quickstart demonstrates embedding a Twitter timeline, a specific tweet, a share button, and a follow button in a React application using the core components provided by `react-twitter-embed`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}