JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 696
  • Score
    100M100P100Q103102F
  • License MIT

Social media share buttons for your Astro site

Package Exports

  • astro-social-share

Readme

Astro Social Share

Social media share buttons for your Astro site

npm

Features

  • No dependencies or external scrips
  • Share buttons for:
    • Facebook
    • Hacker News
    • LinkedIn
    • Reddit
    • Twitter
  • Icons included from https://simpleicons.org/

Demo

Example

Install

npm i astro-social-share

Usage

Simple, include all links

import { SocialShare } from "astro-social-share";

<SocialShare
    description="Description of the page/post"
    via="YourTwitterAccount"
    title="Page Title"
/>

If you'd like to customize the share bar you can import the invidual buttons and pass them into the <SocialShare /> component.

---
import { 
  FacebookShareButton,
  HackerNewsShareButton,
  LinkedInShareButton,
  RedditShareButton,
  TwitterShareButton,
  SocialShare
} from "astro-social-share";

const BUTTONS = [TwitterShareButton, FacebookShareButton]
---

<SocialShare
    buttons={BUTTONS}
    description="Description of the page/post"
    via="YourTwitterAccount"
    title="Page Title"
/>