JSPM

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

Social media share button.

Package Exports

  • react-shareit
  • react-shareit/dist/esm/index.js
  • react-shareit/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-shareit) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-share-kit

🔧 Installation

npm i react-share-kit    # npm
yarn add react-share-kit # yarn

📦 Example

import React from "react";
import { ShareButton } from "react-share-kit";

const Example = () => {
  return (
    <div>
      <ShareButton
        data={{
          text: "Hello React",
          url: "www.example.com",
          title: "React",
        }}
        onClick={() => console.log("shared successfully!")}
      >
        <button>Share</button>
      </ShareButton>
    </div>
  );
};

export default Example;

👀 Props

Prop Description Type Default
data Share Object {text, url, title} {text: "", url: currentURL, title: "Share"}
sites sites string[] all platforms (see list below for key list)
closeText translate close string localise close text
onClick callback on sucessful share
disableNative disables native share boolean false
dark for dark theme boolean false
scrollable for mobile view boolean false

🌎 Sites

  • facebook
  • twitter
  • whatsapp
  • reddit
  • telegram
  • linkedin
  • mail
  • copy (Copy to Clipboard)