Getting Started
Installation
How to quickly add Nuxt Social Share to your Nuxt project.
- Add
@stefanobartoletti/nuxt-social-share
dependency to your project:
npx nuxi@latest module add nuxt-social-share
- Nuxi should have already added
@stefanobartoletti/nuxt-social-share
to themodules
section ofnuxt.config
. If not, add it manually:
nuxt.config.ts
export default defineNuxtConfig({
modules: [
'@stefanobartoletti/nuxt-social-share'
],
})
- 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 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!