All Projects β†’ nicolasbeauvais β†’ Vue Social Sharing

nicolasbeauvais / Vue Social Sharing

Licence: mit
A renderless Vue.js component for sharing links to social networks, compatible with SSR

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue Social Sharing

Vue Awesome Swiper
πŸ† Swiper component for @vuejs
Stars: ✭ 12,072 (+1027.17%)
Mutual labels:  nuxtjs, vue-components, vue-component, vuejs2, ssr
Nextcloud Vue
🍱 Vue.js components for Nextcloud app development ✌
Stars: ✭ 89 (-91.69%)
Mutual labels:  hacktoberfest, vue-components, vuejs-components, vuejs2
vue-notification-bell
Vue.js notification bell component.
Stars: ✭ 64 (-94.02%)
Mutual labels:  vuejs2, vue-components, vue-component, vuejs-components
jooger.me
πŸ‘ My personal website,powered by @nuxt
Stars: ✭ 39 (-96.36%)
Mutual labels:  ssr, vuejs2, vue-component, nuxtjs
Vue Video Player
🎞 @videojs component for @vuejs
Stars: ✭ 4,026 (+275.91%)
Mutual labels:  vue-components, vue-component, vuejs2, ssr
Quasar
Quasar Framework - Build high-performance VueJS user interfaces in record time
Stars: ✭ 20,090 (+1775.82%)
Mutual labels:  vue-components, vue-component, vuejs2, ssr
Vuelayers
Web map Vue components with the power of OpenLayers
Stars: ✭ 532 (-50.33%)
Mutual labels:  hacktoberfest, vue-components, vuejs-components, vuejs2
Lichter.io
My own website and CV
Stars: ✭ 105 (-90.2%)
Mutual labels:  hacktoberfest, nuxtjs, vuejs2
Vue Gmaps
Search places and address using Google Maps API
Stars: ✭ 108 (-89.92%)
Mutual labels:  hacktoberfest, vue-component, vuejs2
Veluxi Starter
Veluxi Vue.js Starter Project with Nuxt JS and Vuetify
Stars: ✭ 39 (-96.36%)
Mutual labels:  nuxtjs, vuejs2, ssr
Vue Form Json Schema
Create forms using JSON schema. Bring your components!
Stars: ✭ 253 (-76.38%)
Mutual labels:  vue-components, vue-component, vuejs2
graduation-web
A PWA for the community of students of CEIT Department at Amirkabir U of Technology (Class of 2018)
Stars: ✭ 25 (-97.67%)
Mutual labels:  ssr, social-network, nuxtjs
Social
πŸŽ‰ Social can be used for work, or to connect to the fediverse!
Stars: ✭ 302 (-71.8%)
Mutual labels:  hacktoberfest, social, social-network
Vuemmerce
πŸ‘‰ Responsive ecommerce template πŸ›’ built with Vue.js and Nuxt.js
Stars: ✭ 223 (-79.18%)
Mutual labels:  nuxtjs, vue-components, vuejs2
Storefront Ui
Customization-first, performance-oriented and elegant UI framework for eCommerce (and not only) based on Vue.js and Google Retail UX Playbook. Made with πŸ’š by Vue Storefront team and contributors.
Stars: ✭ 1,827 (+70.59%)
Mutual labels:  hacktoberfest, vue-components, vuejs2
Vue Touch Ripple
πŸ‘† Touch ripple component for @vuejs
Stars: ✭ 443 (-58.64%)
Mutual labels:  vue-components, vue-component, vuejs2
Vue Swatches
🎨 Help the user picking beautiful colors!
Stars: ✭ 456 (-57.42%)
Mutual labels:  vue-components, vuejs-components, vuejs2
Vue Parallax Js
Tiny vue component that adds a directive for parallax effect on elements.
Stars: ✭ 107 (-90.01%)
Mutual labels:  vue-components, vue-component, vuejs-components
Vue Codemirror
⌨️ @codemirror component for @vuejs
Stars: ✭ 2,115 (+97.48%)
Mutual labels:  vue-components, vue-component, vuejs2
Vue Quill Editor
🍑@quilljs editor component for @vuejs
Stars: ✭ 6,874 (+541.83%)
Mutual labels:  vue-components, vue-component, vuejs2

Vue Social Sharing

A renderless components for sharing links on major social networks

Less than 2.5kb gzipped


Release Build Status Downloads License Vue 1 Vue 2 gzip size


Demo

What is a renderless component?

Renderless components give you the highest possible control over your markup and styling. This means that vue-social-sharing ship with minimal HTML and no CSS to let you adapt the look and feel of the components to your needs. You can learn more about renderless components in this blog article by @adamwathan.

Understanding social sharing

Before using this package it is important to understand how Social Networks handle sharing links on their platform. When you share a link on a Social Network, the Social Network will crawl the link to detect Open Graph meta tags. If you share links that do not contain Open Graph meta tags, the Social Network will not be able to display a rich content for your link. You can refer to the Available properties section of the documentation to check which Social Network accept which properties without Open Graph tags.

Installation

# Yarn
yarn add vue-social-sharing

# NPM
npm install --save vue-social-sharing

Usage

Loading the library

Browserify / Webpack
import VueSocialSharing from 'vue-social-sharing'

Vue.use(VueSocialSharing);
Nuxt
// In your nuxt.config.js file:
modules: [
  'vue-social-sharing/nuxt'
]
HTML
<script src="/dist/vue-social-sharing.js"></script>

Using the Share Network component

<ShareNetwork
    network="facebook"
    url="https://news.vuejs.org/issues/180"
    title="Say hi to Vite! A brand new, extremely fast development setup for Vue."
    description="This week, I’d like to introduce you to 'Vite', which means 'Fast'. It’s a brand new development setup created by Evan You."
    quote="The hot reload is so fast it\'s near instant. - Evan You"
    hashtags="vuejs,vite"
  >
    Share on Facebook
</ShareNetwork>

Available networks and properties

The url is the only property required for all networks.

General properties
Name Data Type Description
tag String HTML tag used to render the network component. Default to "a" tag.
popup.width Number Custom width of the popup window. Default to 626px.
popup.height Number Custom height of the popup window. Default to 426px.      
Network properties
Prop Type Description
url String URL to share.
title String Sharing title (if available).
description String Sharing description (if available).
quote String Facebook quote (Facebook only).
hashtags String A list of comma-separated hashtags (Twitter and Facebook).
twitter-user String Twitter user (Twitter only).
media String Url to a media (Pinterest, VK, Weibo, and Wordpress).
Networks
Network url title description Extras/Comments
Baidu βœ”οΈ βœ”οΈ ❌
Buffer βœ”οΈ βœ”οΈ ❌
Email βœ”οΈ βœ”οΈ βœ”οΈ
EverNote βœ”οΈ βœ”οΈ ❌
Facebook βœ”οΈ βœ”οΈ βœ”οΈ hashtags A list of comma-separated hashtags, only the first one will be used.
quote Facebook quote.
FlipBoard βœ”οΈ βœ”οΈ ❌
HackerNews βœ”οΈ βœ”οΈ ❌
InstaPaper βœ”οΈ βœ”οΈ βœ”οΈ
Line βœ”οΈ βœ”οΈ βœ”οΈ
LinkedIn βœ”οΈ ❌ ❌
Messenger βœ”οΈ ❌ ❌
Odnoklassniki βœ”οΈ βœ”οΈ ❌
Pinterest βœ”οΈ βœ”οΈ ❌ media URL of an image describing the content.
Pocket βœ”οΈ βœ”οΈ ❌
Reddit βœ”οΈ βœ”οΈ ❌
Skype βœ”οΈ βœ”οΈ βœ”οΈ
SMS βœ”οΈ βœ”οΈ βœ”οΈ
StumbleUpon βœ”οΈ βœ”οΈ ❌
Telegram βœ”οΈ βœ”οΈ βœ”οΈ
Tumblr βœ”οΈ βœ”οΈ βœ”οΈ
Twitter βœ”οΈ βœ”οΈ ❌ hashtags A list of comma-separated hashtags.
twitter-user Twitter user to mention.
Viber βœ”οΈ βœ”οΈ βœ”οΈ
VK βœ”οΈ βœ”οΈ βœ”οΈ media URL of an image describing the content.
Weibo βœ”οΈ βœ”οΈ ❌ media URL of an image describing the content.
WhatsApp βœ”οΈ βœ”οΈ βœ”οΈ
Wordpress βœ”οΈ βœ”οΈ βœ”οΈ media URL of an image describing the content.
Xing βœ”οΈ βœ”οΈ ❌
Yammer βœ”οΈ βœ”οΈ βœ”οΈ

For the networks: Line, Skype, SMS, Telegram, Viber, WhatsApp and Yammer; the shared content is a string of the form: "$title $url $description"

Available events

Events that are emitted on the vue $root instance:

Name Data Description
share_network_open Network name, shared url Fired when a sharing popup is open
share_network_change Network name, shared url Fired when the user open a new sharing popup while another is already open
share_network_close Network name, shared url Fired when a sharing popup is closed or changed by another popup

You can listen to a vue-social-sharing $root event by using the following code:

Vue.$root.$on('share_network_open', function (network, url) {
  // your event code
});

Events that are emitted on the local vue-social-sharing instance:

Name Data Description
open Network name, shared url Fired when a sharing popup is open
change Network name, shared url Fired when the user open a new sharing popup while another is already open
close Network name, shared url Fired when a sharing popup is closed or changed by another popup

You can listen to a ShareNetwork local event by using the following code:

<ShareNetwork @open="open" @change="change" @close="close" />

Note that the share_network_close event will not be fired for the WhatsApp, SMS and Email sharers.

Extending the network list

In version 3.x you can extend and override the list of available networks. You can see a working example of the feature in the examples/index.js file:

import Vue from 'vue'
import VueSocialSharing from '@/vue-social-sharing'

Vue.use(VueSocialSharing, {
  networks: {
    fakeblock: 'https://fakeblock.com/[email protected]&[email protected]'
  }
})

new Vue({
  el: '#app',
})

Extending the network list in Nuxt

You can extend the list of available networks directly in your nuxt.config.js file:

modules: [
  ['vue-social-sharing/nuxt', {
    networks: {
      fakeblock: 'https://fakeblock.com/[email protected]&[email protected]'
    }
  }],
]

Customizing the popup window size

If needed, you can set a custom width and height for the popup window:

<ShareNetwork :popup="{width: 400, height: 200}" />

Feature request

Feel free to open an issue to ask for a new social network support.

Changelog

Detailed changes for each release can be found in CHANGELOG.md.

Issues

Please make sure to read the Issue Reporting Checklist before opening an issue. Issues not conforming to the guidelines may be closed immediately.

Contribution

Please make sure to read the Contributing Guide before making a pull request.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].