npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-tweet-embed

v2.4.0

Published

Embed tweets in your vue.js app

Downloads

12,392

Readme

CircleCI Greenkeeper badge

vue-tweet-embed

Embed tweets in your vue.js app.
Inspired by https://github.com/capaj/react-tweet-embed

Install

npm install vue-tweet-embed

Supported components

Currently only Tweet and Moment components are supported form Twitter's widget API.
Components can be imported in one statement:

import { Tweet, Moment, Timeline } from 'vue-tweet-embed'

or individually

import Tweet from 'vue-tweet-embed/tweet'
import Moment from 'vue-tweet-embed/moment'
import Timeline from 'vue-tweet-embed/timeline'

Moment component can be used the same way Tweet component is used (see below).

Quickstart

import { Tweet } from 'vue-tweet-embed'

<Tweet id="692527862369357824"></Tweet>
<Tweet id="14"></Tweet>	// test tweet not available or deleted

You don't have to put //platform.twitter.com/widgets.js script in your index.html as this lib will put it there if twttr is not found on window.

Using Options

Tweet & Moment

<Tweet id="783943172057694208" :options="{ cards: 'hidden' }"/>
<Tweet id="771763270273294336" :options="{ theme: 'dark' }"/>

Embedded-Tweet Options Reference: https://dev.twitter.com/web/embedded-tweets/parameters

Timeline

<Timeline id="twitterdev" sourceType="profile" :options="{ tweetLimit: '3' }"/>
<Timeline id="twitterdev" sourceType="likes" :options="{ theme: 'dark' }"/>
<Timeline id="twitterdev" sourceType="list" />

Only sourceType: profile, likes and list are integrated. Embedded-Timeline Options Reference: https://dev.twitter.com/web/embedded-timelines/parameters

Showing a placeholder while the tweet is being loaded

To show some content to the user while the tweet is being loaded, just put it inside the Tweet component. Placeholder content will be removed automatically once the tweet has finished loading.

<Tweet id="783943172057694208"><div class="spinner"></div></Tweet>

Adding a custom class on the widget

To add an extra class on the container when the widget is loaded just add the class(es) with the prop: widget-class

<Timeline id="twitterdev" source-type="profile" widget-class="mt-3 my-custom-class"/></Timeline>

Show some text if the tweet is unavailable

Tweets that could not be loaded can be replaced with custom text. A custom class can be specifier as well.

<Tweet id="14" error-message="This tweet could not be loaded" error-message-class="tweet--not-found"/>

Custom html message:

<tweet error-message="Sorry the tweet is not available. Search on <a href='https://twitter.com'>twitter</a>"></tweet>