
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
twitter-status
Advanced tools
Twitter Status Web Component
Base example

Example with attached image

Example with hyperlinked hashtags/mentions/URLs and links colored from profile settings.

Load directly from unpkg:
<script async src="https://unpkg.com/twitter-status@latest/dist/twitter-status.min.js"></script>
Or installed as a dependency:
npm install twitter-status
And imported:
import 'twitter-status';
twitter-status relies on the shadow DOM and custom elements standards. You will likely need a polyfill until browser support is more ubiquitous.
Polyfills can be loaded via unpkg directly.
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@2/bundles/webcomponents-sd-ce.js"></script>
Or installed as a dependency:
npm install @webcomponents/webcomponentsjs
And imported:
import '@webcomponents/webcomponentsjs/bundles/webcomponents-sd-ce';
<twitter-status> takes a single value status that must be the full response of GET statuses/show/:id with the parameters include_entities=true and tweet_mode=extended.
You can embed the tweet in the HTML as a JSON string:
<twitter-status status="{\"id_str\":\"20\",...}"></twitter-status>
Or set the property in JS:
<twitter-status></twitter-status>
<script>
  document.querySelector('twitter-status').status = { "id_str": "20", ... };
</script>
You can theme the borders. Here is an card example.
<style>
  twitter-status.card {
    box-shadow: 0 3px 4px 1px rgba(0, 0, 0, .08), 0 1px 1px 1px rgba(0, 0, 0, .05);
    border-radius: 2px;
    border-width: 0;
  }
</style>
<twitter-status class="card" status="{\"id_str\":\"20\",...}"></twitter-status>

TweetLooking for a way to embed users? Check out <twitter-user>.
TwitterStatus is released under an MIT license.
TwitterStatus is not affiliated Twitter, Inc.
Built, tested, and published with Nutmeg.
FAQs
Twitter Status Web Component
The npm package twitter-status receives a total of 110 weekly downloads. As such, twitter-status popularity was classified as not popular.
We found that twitter-status demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.