Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-web-share

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-web-share

Tiny Web Share API Wrapper with fallback for unsupported browsers

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13K
increased by7.21%
Maintainers
1
Weekly downloads
 
Created
Source

react-web-share

Tiny Web Share API wrapper with fallback for unsupported browsers

GitHub Actions Status NPM gzip

Edit react-web-share

💡 most browsers restricts web share api only to https websites

✨ Features

  • 🍃 Only ~6kb gzipped and no external dependencies
  • 🌀 Uses React Portal
  • ✌ Written w/ TypeScript

🔧 Installation

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

Preview

Mobile

Mobile Preview

Desktop

Desktop Preview

📦 Example

import React, { useState } from "react";
import { RWebShare } from "react-web-share";

const Example = () => {
  return (
    <div>
      <RWebShare
        data={{
          text: "Like humans, flamingos make friends for life",
          url: "https://on.natgeo.com/2zHaNup",
          title: "Flamingos",
        }}
        onClick={() => console.log("shared successfully!")}
      >
        <button>Share 🔗</button>
      </RWebShare>
    </div>
  );
};

export default Example;

👀 Props

PropDescriptionTypeDefault
dataShare Object{text, url, title}{text: "", url: currentURL, title: "Share"}
sitessitesstring[]all platforms (see list below for key list)
closeTexttranslate closestringlocalise close text
onClickcallback on sucessful share
disableNativedisables native sharebooleanfalse

🌎 Sites

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

📜 License

MIT © harshzalavadiya

Keywords

FAQs

Package last updated on 27 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc