twitter-button
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

twitter-button GitHub Actions Status devDependency Status

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 of twitter-follow-button
  • user: string, Twitter ID to follow
  • size: string, must be either s or l, default to s

TwitterHashtagButton

  • width: number, width of twitter-hashtag-button
  • text: string, text to share
  • hashtag: string, hashtag to attach
  • size: string, must be either s or l, default to s

TwitterMentionButton

  • width: number, width of twitter-mention-button
  • user: string, Twitter ID to mention
  • size: string, must be either s or l, default to s

TwitterShareButton

  • width: number, width of twitter-share-button
  • url: string, URL to share
  • user: string, Twitter ID
  • text: string, text to share
  • size: string, must be either s or l, default to s

License

MIT © Shogo Sensui

Readme

Keywords

Package Sidebar

Install

npm i twitter-button

Weekly Downloads

17

Version

0.4.0

License

MIT

Unpacked Size

49.6 kB

Total Files

31

Last publish

Collaborators

  • 1000ch