Skip to content

Block 54 of 297

Share Links

Spread-the-word panel with labelled Facebook, LinkedIn, Bluesky and email share links built as plain URLs.

Puck key
ShareLinksBlock
Export
shareLinksBlock
React component
<ShareLinks />
Path
components/puck/share-links-block.tsx
Dependencies
None
License
MIT

About this block

When to use it, how to write for it, and what to change in the code.

What it's for

A spread-the-word panel with labelled share buttons for Facebook, LinkedIn, Bluesky and email, built as plain share URLs with no scripts or tracking pixels. An optional card beside the buttons previews the suggested message and link. On phones the buttons stack in one column and the preview moves below them.

  • The end of an event or service announcement people may pass along
  • A petition, advocacy or awareness campaign page
  • A news release or blog post the organization wants shared
Writing the content
  • Paste the full Page URL to share, starting with https://. Facebook and LinkedIn stay hidden until it's set.
  • The Suggested message fills Bluesky posts and emails only; Facebook and LinkedIn read the page's own social metadata.
  • Add, remove or reorder Share options (one to four); duplicates are ignored. There's no copy-link button, since it would need JavaScript.
  • Leave Email subject blank to reuse the message.
Accessibility
  • Each button reads as plain text, like "Share on LinkedIn" or "Send by email", rather than relying on a logo alone (WCAG 2.4.4).
  • Links that open a new tab include hidden "(opens in a new tab)" text; the network logos and arrows are hidden from assistive technology.
  • Buttons are at least 48px tall with an indigo focus outline.
Customizing the code
  • Share URL formats live in the shareHref function. Add a network by adding a case there and an entry with label and icon path in networkMeta.
  • The preview card's offset backing is the bg-indigo-100 layer with translate-x-2 translate-y-2.

Editor fields

What content editors see in the P1 sidebar when they select this block.

  • Headingtext
  • Heading levelselect
  • Bodytextarea
  • Page URL to sharetext
  • Suggested messagetextarea
  • Email subjecttext
  • Share optionsarray
  • Show message previewradio