DEV Community

Cover image for A new version of Nuxt Social Share has been released, providing enhanced customization features! 🚀
Stefano Bartoletti
Stefano Bartoletti

Posted on • Edited on

3

A new version of Nuxt Social Share has been released, providing enhanced customization features! 🚀

✨ A new version of "Nuxt Social Share" module has been released!

⚙️ New features in v0.7.0 include the ability to customize both the label and the icon of each social share button, enhancing its customization capabilities.

New Features

Label and icon can now be easily customized with dedicated slots, this leads to:

  • improved design options: it is now possible to set up label-only buttons by disabling the icon rendering.
  • better integration with your custom design: you can now use any icon style you need, instead of relying on the defaults provided by the module.
  • support for localization: being able to customize the label (and the aria-label attribute) means that you can now localize the component in any language you need to provide in your app.

Example

To customize label and icon, you can use the provided slots:

<SocialShare
  v-for="network in ['facebook', 'twitter', 'linkedin']"
  :key="network"
  :network="network"
>
  <!-- Custom icon, i.e. from NuxtIcon -->
  <template #icon><Icon name="mdi:${network}" /></template>
  <!-- Custom label, renders the network name -->
  <template #label>{{ network }}</template>
</SocialShare>
Enter fullscreen mode Exit fullscreen mode

Detailed examples and full documentation is available on the repository's readme

Installation & update

Installing or updating the module is as simple as running

npx nuxi@latest module add nuxt-social-share
Enter fullscreen mode Exit fullscreen mode

this nuxi command will:

  • install the module as a dependency using your package manager
  • add it to your package.json file
  • update your nuxt.config file

Please leave your appreciation by commenting on this post!

I can do that

Top comments (0)

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay