Getting Started
Installation
How to quickly add Nuxt Social Share to your Nuxt project.
Installation
Add @stefanobartoletti/nuxt-social-share dependency to your project:
npx nuxi@latest module add nuxt-social-share
pnpm i -D @stefanobartoletti/nuxt-social-share
yarn add -D @stefanobartoletti/nuxt-social-share
npm install -D @stefanobartoletti/nuxt-social-share
Nuxi should have already added @stefanobartoletti/nuxt-social-share to the modules section of nuxt.config. If not, add it manually:
nuxt.config.ts
export default defineNuxtConfig({
modules: [
'@stefanobartoletti/nuxt-social-share'
],
})
Configuration
Add your website base URL to the module options:
nuxt.config.ts
export default defineNuxtConfig({
// module options
socialShare: {
baseUrl: 'https://www.yoursite.com' // required!
// other optional module options
}
})
Use
Use the <SocialShare> component wherever you need it in your app:
<SocialShare network="facebook" :styled="true" />
That's it, this is all that is required to start using Nuxt Social Share!
Tailwind Compatibility
Tailwind v4 Required: Starting from version v2.0.0, this module requires Tailwind v4. It's no longer compatible with Tailwind v3 (used also by the current version of @nuxtjs/tailwindcss module). Read more.