https://github.com/jellydn/sharing-btn
Sharing Button - Web Component using Stencil
https://github.com/jellydn/sharing-btn
stenciljs web-component
Last synced: 6 months ago
JSON representation
Sharing Button - Web Component using Stencil
- Host: GitHub
- URL: https://github.com/jellydn/sharing-btn
- Owner: jellydn
- License: mit
- Created: 2023-01-05T14:46:24.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-09T15:41:25.000Z (6 months ago)
- Last Synced: 2025-04-09T16:47:37.758Z (6 months ago)
- Topics: stenciljs, web-component
- Language: TypeScript
- Homepage:
- Size: 516 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README

Welcome to sharing-btn 👋
> Social Sharing Buttons
[![IT Man - Tech #31 - Sharing Button - Web Component using Stencil [Vietnamese]](https://i.ytimg.com/vi/jZUm2bHyF90/hqdefault.jpg)](https://www.youtube.com/watch?v=jZUm2bHyF90)
### ✨ [Demo](https://codepen.io/jellydn-1472379186/pen/wvxoGJM)
## Usage
```html
```
## Stencil
Stencil is a compiler for building fast web apps using Web Components.
Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec.
Stencil components are just Web Components, so they work in any major framework or with no framework at all.
## Getting Started
To start building a new web component using Stencil, clone this repo to a new directory:
```bash
git clone https://github.com/jellydn/sharing-btn.git sharing-btn
cd sharing-btn
git remote rm origin
```and run:
```bash
npm install
npm start
```To build the component for production, run:
```bash
npm run build
```To verify output after build, run:
```bash
npx serve www
```This will start a local development server and serve your project at the specified address (http://localhost:3000 by default).
Open a web browser and navigate to the specified address to view your project.

To run the unit tests for the components, run:
```bash
npm test
```Need help? Check out our docs [here](https://stenciljs.com/docs/my-first-component).
## Naming Components
When creating new component tags, we recommend _not_ using `stencil` in the component name (ex: ``). This is because the generated component has little to nothing to do with Stencil; it's just a web component!
Instead, use a prefix that fits your company or any name for a group of related components. For example, all of the Ionic generated web components use the prefix `ion`.
## Using this component
There are three strategies we recommend for using web components built with Stencil.
The first step for all three of these strategies is to [publish to NPM](https://docs.npmjs.com/getting-started/publishing-npm-packages).
### Script tag
- Put a script tag similar to this `` in the head of your index.html
- Then you can use the element anywhere in your template, JSX, html etc### Node Modules
- Run `npm install sharing-btn --save`
- Put a script tag similar to this `` in the head of your index.html
- Then you can use the element anywhere in your template, JSX, html etc### In a stencil-starter app
- Run `npm install sharing-btn --save`
- Add an import to the npm packages `import sharing-btn;`
- Then you can use the element anywhere in your template, JSX, html etc## Credits
I would like to extend our gratitude to the following resources:
- [Sharingbuttons](https://Sharingbuttons.io) - Super fast and easy Social Media Sharing Buttons. No JavaScript. No tracking.
- [StencilJS](https://stenciljs.com/) - A Web Component compiler for building fast, reusable UI components.## Author
👤 **Dung Huynh**
- Website: https://productsway.com/
- Twitter: [@jellydn](https://twitter.com/jellydn)
- Github: [@jellydn](https://github.com/jellydn)## Show your support
[](https://ko-fi.com/dunghd)
[](https://paypal.me/dunghd)
[](https://www.buymeacoffee.com/dunghd)## 📝 License
This project is [MIT](https://github.com/jellydn/sharing-btn/blob/master/LICENSE) licensed.