Share this article: ten share buttons in brand colours
Share buttons for ten networks under an article headline
Vertical share rail with eight networks beside an article, styled by the site theme
Inline share buttons aligned to the end of a news story header
Share buttons beside the headline of an event page
The Share component selected in Drupal Canvas with its settings panel
Share block settings: title, alignment, orientation, mobile visibility, native share and placement
Webshare platforms table with thirteen networks, drag to reorder and enable
Add Platform form with a custom sharing URL template

This project is not covered by Drupal’s security advisory policy.

Share buttons for Drupal. Visitors share the page they are reading on the networks you choose, or through the share sheet on their own device.

What you get

  • Share block. Place it in any region from Block layout, once or several times, each with its own settings.
  • Share component. A single-directory component, webshare:share, with the same settings as the block. Use it in Twig templates or drop it into a page in Drupal Canvas.
  • Views field. Add share buttons to every row of a view.
  • 13 networks ready to use. LinkedIn, Facebook, X, WhatsApp, Telegram, Reddit, Pinterest, Threads, Bluesky, Tumblr, Mastodon, Email and Copy URL. Enable the ones you want and drag them into order.
  • Your own platforms. Add any network with a name, an icon and a URL template that uses [url] and [title].
  • Native share button. Opens the device share sheet through the Web Share API. On browsers without it, the button copies the link.

Settings on every placement

  • Title, shown or hidden, with a heading level that fits the page outline.
  • Horizontal row or vertical column.
  • Start or end side. It follows the text direction, so it flips in right-to-left languages.
  • Inline with the content, or a sticky rail that follows the reader beside the content.
  • Show on all devices, hide on mobile, or show on mobile only.

For themers and developers

  • Restyle the buttons with CSS custom properties, or override the component in your theme.
  • Optional support for the Drupal core Icons API, so the buttons can use your site icon pack.
  • Config actions for recipes: set, save, enable, disable, reorder and delete platforms.
  • The buttons render as a nav landmark with a label on every link, and work with the keyboard.
  • Covered by automated browser tests on Drupal 11 and Drupal 12, including Drupal Canvas.

Requirements

Drupal core 11.4 or later, or Drupal 12. No contributed modules are needed. Drupal Canvas is optional.

Install

composer require drupal/webshare

Enable the module, choose your networks at Configuration » Web services » Webshare, then place the Share block or add the Share component to a page.

Supporting organizations: 

Project information

Releases