0.0.2 • Published 8 years ago
@ngx-share-pat/buttons v0.0.2
Share buttons component
Use <share-buttons> component to a collection of share buttons.
Share buttons component is built on top of ShareModule and ShareButtonModule so you need to install both @ngx-share/core, @ngx-share/button and @ngx-share/buttons.
To use the default icons, install font-awesome package.
$ npm install --save @ngx-share/core @ngx-share/button @ngx-share/buttons font-awesomeImport ShareButtonModule in your module
import { ShareButtonModule } from '@ngx-share/button';
@NgModule({
imports: [
HttpClientModule, // (Required) for share counts
HttpClientJsonpModule, // (Optional) For linkedIn & Tumblr counts
ShareButtonModule.forRoot()
]
})Import core styles and theme from the global style src/styles.scss
@import '~font-awesome/css/font-awesome.min.css';
@import "~@ngx-share/button/styles/share-buttons";
@import "~@ngx-share/button/styles/themes/default/default-theme";Check all themes
Now you can use the component in your template
<share-buttons></share-buttons>Check ShareButtons Component Demo
| Name | Default value | Description |
|---|---|---|
| include | all buttons | Include certain buttons. Button's order will be as you type it. |
| exclude | Exclude certain buttons. | |
| show | null | Number of buttons to show, if defined 'more' button will appear. |
| theme | null | Set button theme. |
| size | 0 | Button size, e.g. -4, 2.5, 1...etc. |
| url | current URL | Sharing link. |
| title | null | Override title meta tag for LinkedIn and Reddit. |
| description | null | Override description meta tag for LinkedIn, WhatsApp, Telegram and Pinterest |
| image | null | Override image meta tag for Pinterest only. |
| tags | null | Override tags for Tumblr and Twitter. |
| showIcon | true | Show button icon. |
| showText | false | Show button text. |
| showCount | false | Show share count. |
| (opened) | button name | Stream that emits when share window has opened. |
| (closed) | button name | Stream that emits when share dialog has closed. |
| (count) | share count | Stream that emits share count of the share URL. |
Issues
If you identify any errors in this component, or have an idea for an improvement, please open an issue. I am excited to see what the community thinks of this project, and I would love your input!
Support
License
Author
Murhaf Sousli
