Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/1000ch/twitter-button
Twitter button as Web Components.
https://github.com/1000ch/twitter-button
twitter web-components
Last synced: 27 days ago
JSON representation
Twitter button as Web Components.
- Host: GitHub
- URL: https://github.com/1000ch/twitter-button
- Owner: 1000ch
- License: mit
- Created: 2021-02-02T04:40:20.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-10T12:30:08.000Z (about 3 years ago)
- Last Synced: 2024-08-11T00:03:44.826Z (3 months ago)
- Topics: twitter, web-components
- Language: TypeScript
- Homepage: https://1000ch.github.io/twitter-button/
- Size: 436 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# twitter-button ![GitHub Actions Status](https://github.com/1000ch/twitter-button/workflows/test/badge.svg)
Twitter button as Web Components.
## Install
Using npm:
```bash
$ npm install twitter-button
```## Usage
Import and register scripts.
```html
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);```
Just put ``, ``, ``, and `` element in your HTML.
```html
```
### `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](https://1000ch.mit-license.org) © [Shogo Sensui](https://github.com/1000ch)