README
twitter-button
Twitter button as Web Components.
Install
Using npm:
$ npm install twitter-button
Usage
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-button
user
: string, Twitter ID to followsize
: string, must be eithers
orl
, default tos
TwitterHashtagButton
width
: number, width oftwitter-hashtag-button
text
: string, text to sharehashtag
: string, hashtag to attachsize
: string, must be eithers
orl
, default tos
TwitterMentionButton
width
: number, width oftwitter-mention-button
user
: string, Twitter ID to mentionsize
: string, must be eithers
orl
, default tos
TwitterShareButton
width
: number, width oftwitter-share-button
url
: string, URL to shareuser
: string, Twitter IDtext
: string, text to sharesize
: string, must be eithers
orl
, default tos