Registry / web-framework / vue3-social-sharing

vue3-social-sharing

JSON →
library1.4.1jsnpmunverified

Vue 3 plugin for sharing links on social networks (Facebook, Twitter/X, LinkedIn, WhatsApp, etc.) with TypeScript support. Version 1.4.1 supports 30+ networks including Bluesky and Threads. Works as a composable, a Vue plugin with a <share-network> component, or a renderless component. Design-agnostic, no CSS included. A modern fork of vue-social-sharing (Vue 2). Peer dependency: vue ^3.3.11.

npm install vue3-social-sharing
INSTALL
IMPORT
SIG · VUE3-SOCIAL-SHARIN
V
vue3-social-sharing
web-frameworkjavascriptv1.4.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

useShareLink
✓ import { useShareLink } from 'vue3-social-sharing'
✗ import { useShareLink } from 'vue3-social-sharing/src'
Named export from main entry. Available as composable function.
ShareNetwork
✓ import { ShareNetwork } from 'vue3-social-sharing'
✗ import ShareNetwork from 'vue3-social-sharing'
Named export, not default. Use as renderless component with v-slot.
Vue3SocialSharingPlugin
✓ import Vue3SocialSharingPlugin from 'vue3-social-sharing'
✗ import { Vue3SocialSharingPlugin } from 'vue3-social-sharing'
Default export for app.use(). Options object with optional networks config.
shareLink
✓ const { shareLink } = useShareLink()
✗ import { shareLink } from 'vue3-social-sharing'
shareLink is returned from the composable, not a direct export.

This shows a minimal Vue 3 component using the useShareLink composable to share a URL on Facebook.

<script setup lang="ts"> import { useShareLink } from 'vue3-social-sharing'; import { ref } from 'vue'; const { shareLink } = useShareLink(); const url = ref('https://example.com'); const shareOnFacebook = () => { shareLink({ network: 'facebook', url: url.value, quote: 'Check this out!' }); }; </script> <template> <button @click="shareOnFacebook">Share on Facebook</button> </template>
Debug
Known issues
gotchanetwork property is required and must be a valid network name from the list. Case-sensitive.
fix
Check the list of supported networks: facebook, twitter, linkedin, etc.
affects: >=1.0.0
gotchaOnly the url property is required across all networks; other properties (title, description, etc.) are network-dependent and may be silently ignored.
fix
Provide url and network; test share result with each network.
affects: >=1.0.0
breakingVersion 1.4.0 added Bluesky network; if you upgrade from <1.4.0, note new network names.
fix
Update network names accordingly.
affects: >=1.4.0
deprecatedTwitter network exists separately from X; both are valid but X is recommended.
fix
Use network: 'x' instead of 'twitter'.
affects: >=1.1.0
gotchaThe package does not include any default styles; UI must be implemented manually.
fix
Style your own buttons/spans. Use v-slot to customize.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'vue3-social-sharing' or its corresponding type declarations.
TypeScript is not configured to resolve module paths correctly.
fix
Ensure tsconfig.json includes 'moduleResolution': 'node' or 'bundler' and 'module': 'esnext'.
TypeError: shareLink is not a function
shareLink is not imported directly; it is returned from useShareLink composable.
fix
Use const { shareLink } = useShareLink() inside setup.
Failed to resolve component: share-network
Missing plugin registration or component import.
fix
If using plugin: app.use(Vue3SocialSharingPlugin). If using component: import { ShareNetwork } from 'vue3-social-sharing'.
Property 'network' does not exist on type 'ShareNetworkProps'
TypeScript type not recognized due to incorrect import.
fix
Import ShareNetwork as named import: import { ShareNetwork } from 'vue3-social-sharing'.
Upgrade
Version history
1.4.1latest on npm
Audit
Dependencies
vuerequiredpeer dependency required for Vue 3 plugin
Agent activity
36 hits · last 30 days
node
32
OpenAI (training)
1
Resources
vue3-social-sharing — npm install vue3-social-sharing · libregistry