0.4.0 • Published 5 years ago
twitter-button v0.4.0
twitter-button

Twitter button as Web Components.
Install
Using npm:
$ npm install twitter-buttonUsage
Import and register scripts.
<script type="module">
import { TwitterFollowButton } from 'https://unpkg.com/twitter-button/dist/twitter-follow-button.js';
import { TwitterHashtagButton } from 'https://unpkg.com/twitter-button/dist/twitter-hashtag-button.js';
import { TwitterMentionButton } from 'https://unpkg.com/twitter-button/dist/twitter-mention-button.js';
import { TwitterShareButton } from 'https://unpkg.com/twitter-button/dist/twitter-share-button.js';
customElements.define('twitter-follow-button', TwitterFollowButton);
customElements.define('twitter-hashtag-button', TwitterHashtagButton);
customElements.define('twitter-mention-button', TwitterMentionButton);
customElements.define('twitter-share-button', TwitterShareButton);
</script>Just put <twitter-follow-button>, <twitter-hashtag-button>, <twitter-mention-button>, and <twitter-share-button> element in your HTML.
<twitter-follow-button></twitter-follow-button>
<twitter-hashtag-button></twitter-hashtag-button>
<twitter-mention-button></twitter-mention-button>
<twitter-share-button></twitter-share-button>TwitterFollowButton
width: number, width oftwitter-follow-buttonuser: string, Twitter ID to followsize: string, must be eithersorl, default tos
TwitterHashtagButton
width: number, width oftwitter-hashtag-buttontext: string, text to sharehashtag: string, hashtag to attachsize: string, must be eithersorl, default tos
TwitterMentionButton
width: number, width oftwitter-mention-buttonuser: string, Twitter ID to mentionsize: string, must be eithersorl, default tos
TwitterShareButton
width: number, width oftwitter-share-buttonurl: string, URL to shareuser: string, Twitter IDtext: string, text to sharesize: string, must be eithersorl, default tos