Getting Started
Module Options
Customize Nuxt Social Share according to your needs.
Nuxt Social Share provides some module options that you can set to customize it according to your needs. You must set them by using the socialShare
key inside your nuxt-config
:
nuxt.config.ts
export default defineNuxtConfig({
// module options
socialShare: {
baseUrl: 'https://www.yoursite.com' // required!
// other optional module options
}
})
Options
Name | Required | Type | Default | Notes |
---|---|---|---|---|
baseUrl | Yes | String | '' | This is the base URL of your website, likely the address of the homepage. It is required, all URLs to be shared will be built as relative paths to this. You can also use an enviromment variable. |
styled | No | Boolean | false | Whether the <SocialShare> components should be styled or not. It is false by default to allow for easier integration in any UI ✳️. |
label | No | Boolean | true | Whether the text label in the <SocialShare> components should be rendered or not ✳️. |
icon | No | Boolean | true | Whether the icon in the <SocialShare> components should be rendered or not ✳️. |
Options marked with ✳️ can also be set on a single component level via props.
Anyway, it is usually better to set them from the module options to create your defaults, and override it with props only if needed.