vue-share-it
A Vue.js component for sharing links to social networks.
Features
- Easy install
- Highly customizable
- Extensive documentation & examples
- Developer support
- SEO friendly
Installation
Usage
Browserify / Webpack
HTML
Supported social-media platforms
Platform | Value |
---|---|
API
Props
Prop | Data type | Default | Description |
---|---|---|---|
text | String | '' | Caption |
url | String | '' | URL to share |
width | Number | 600 | Width of the share window |
height | Number | 600 | Height of the share window |
dense | Boolean | false | Dense button styling |
dark | Boolean | false | Dark button styling |
targets | Array | [] | Specify social media targets, defaults to all available targets |
icons | Boolean | false | Use icons as buttons |
outline | Boolean | false | Outline button styling |
round | Boolean | false | Round button styling for icons |
iconSize | String | lg | Specify icon size. See size chart below |
shareConfig | Object | { linkedin: {}, twitter: {}, facebook: {}, whatsapp: {}, reddit: {}, } |
Advanced configuration for target specific styling |
Events
Name | Description | Value |
---|---|---|
clicked | Event that is emitted when a share button is clicked | Returns social media platform which was clicked. E.g. ["twitter"] |
Slots
Name | Description |
---|---|
${platform}-icon |
Custom icon for platform |
${platform}-label |
Custom label for platform |
Examples
Using vue-share-it component
Default
Global configs
Targets
Dark
Dense
Outlined
Button configs
Icons
Outlined icons
Rounded icons
Icon configs
Using slots
Size chart
Code | Size |
---|---|
xs | .75em |
sm | .875em |
lg | 1.33em |
2x | 2em |
3x | 3em |
4x | 4em |
5x | 5em |
6x | 6em |
7x | 7em |
8x | 8em |
9x | 9em |
10x | 10em |