{"id":13456374,"url":"https://github.com/andrewsuzuki/react-twitter-widgets","last_synced_at":"2025-04-12T15:38:33.050Z","repository":{"id":40302543,"uuid":"53094061","full_name":"andrewsuzuki/react-twitter-widgets","owner":"andrewsuzuki","description":"Twitter widgets as React components","archived":false,"fork":false,"pushed_at":"2022-09-07T18:42:52.000Z","size":2483,"stargazers_count":280,"open_issues_count":2,"forks_count":60,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-03T15:11:23.335Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://andrewsuzuki.github.io/react-twitter-widgets/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewsuzuki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-04T00:15:50.000Z","updated_at":"2025-02-08T22:19:28.000Z","dependencies_parsed_at":"2022-07-20T13:32:15.056Z","dependency_job_id":null,"html_url":"https://github.com/andrewsuzuki/react-twitter-widgets","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewsuzuki%2Freact-twitter-widgets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewsuzuki%2Freact-twitter-widgets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewsuzuki%2Freact-twitter-widgets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewsuzuki%2Freact-twitter-widgets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewsuzuki","download_url":"https://codeload.github.com/andrewsuzuki/react-twitter-widgets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248590602,"owners_count":21129857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T08:01:20.814Z","updated_at":"2025-04-12T15:38:33.018Z","avatar_url":"https://github.com/andrewsuzuki.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# react-twitter-widgets\n\n[![npm version](https://badge.fury.io/js/react-twitter-widgets.svg)](https://badge.fury.io/js/react-twitter-widgets)\n[![npm downloads](https://img.shields.io/npm/dm/react-twitter-widgets.svg)](https://badge.fury.io/js/react-twitter-widgets)\n[![GitHub issues](https://img.shields.io/github/issues/andrewsuzuki/react-twitter-widgets)](https://github.com/andrewsuzuki/react-twitter-widgets/issues)\n\nQuick and easy Twitter widgets for React.\n\nAvailable widgets: `Timeline`, `Share`, `Follow`, `Hashtag`, `Mention`, `Tweet`.\n\nSee below for usage.\n\n## Demo\n\n**[Storybook / Live Demo](https://andrewsuzuki.github.io/react-twitter-widgets/)**\n\n## Installation\n\n```\nnpm install --save react-twitter-widgets\n```\n\n## Example\n\n```javascript\nimport { Timeline } from 'react-twitter-widgets'\n\n// Tweet (without options)\n\u003cTweet tweetId=\"841418541026877441\" /\u003e\n\n// Timeline (with options)\n\u003cTimeline\n  dataSource={{\n    sourceType: 'profile',\n    screenName: 'TwitterDev'\n  }}\n  options={{\n    height: '400'\n  }}\n/\u003e\n```\n\n## Usage\n\n[**🔗 Official Twitter Documentation**](https://developer.twitter.com/en/docs/twitter-for-websites/javascript-api/guides/scripting-factory-functions)\n\nAvailable widgets: `Timeline`, `Share`, `Follow`, `Hashtag`, `Mention`, `Tweet`\n\n**`Timeline`** requires a `dataSource` object prop. The source type can be `profile`, `list`, or `url`. They each require their own co-fields; see Twitter documentation. NOTE that `collection`, `likes`, and `moments` will be [deprecated](https://twittercommunity.com/t/removing-support-for-embedded-like-collection-and-moment-timelines/150313) on June 23, 2021.\n\n**`Share`** requires a `url` prop.\n\n**`Follow`** and **`Mention`** require a `username` prop. NOTE that the Twitter\ndocumentation now refers to this as _screenName_.\n\n**`Hashtag`** requires a `hashtag` prop.\n\n**`Tweet`** requires a `tweetId` prop. Ex. `'511181794914627584'`\n\n### Common Props\n\nAll widgets accept these props.\n\n- `options` (object)\n  - To learn more about the available options, refer to the Twitter documentation. There are four options that are common to all widgets (`lang`, `dnt`, `related`, and `via`). There are further options for button widgets, tweet buttons, Timeline, and Tweet.\n- `onLoad` (function)\n  - Called every time the widget is loaded. A widget will reload if its props change.\n- `renderError` (function)\n  - Render prop. Rendered if widget cannot be loaded (no internet connection, screenName not found, bad props, etc).\n  - Example: `renderError={(_err) =\u003e \u003cp\u003eCould not load timeline\u003c/p\u003e}`\n\n### Lazy vs. Eager Loading\n\nBy default, the remote Twitter library will be lazy-loaded when the first widget renders. To instead load it eagerly, call `eagerLoadTwitterLibrary`.\n\n```js\nimport { eagerLoadTwitterLibrary } from \"react-twitter-widgets\";\neagerLoadTwitterLibrary();\n```\n\n## Further Information\n\n- This library loads the remote _Twitter for Websites_ library.\n- Twitter widgets are only loaded in the browser. A blank div will be rendered during SSR.\n\n## Contributing\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request\n\n## Credits\n\n- Andrew Suzuki - @andrewsuzuki - [andrewsuzuki.com](http://andrewsuzuki.com)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewsuzuki%2Freact-twitter-widgets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewsuzuki%2Freact-twitter-widgets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewsuzuki%2Freact-twitter-widgets/lists"}