Package Exports
- react-web-share
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-web-share) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-web-share
Tiny Web Share API wrapper with fallback for unsupported browsers
💡 most browsers will restrict web share api only to https websites
✨ Features
- 🍃 Only ~3kb gzipped and no external dependencies
- ✌ Written w/ TypeScript
🔧 Installation
npm i react-web-share # npm
yarn add react-web-share # yarn
Preview
Mobile
Desktop
📦 Example
import React, { useState } from "react";
import MultiSelect from "react-web-share";
const Example: React.FC = () => {
return (
<div>
<RWebShare
data={{
text: "Like humans, flamingos make friends for life",
url: "https://bit.ly/2UWTnlL",
title: "Share this article on Flamingos",
}}
>
<button>Share 🔗</button>
</RWebShare>
</div>
);
};
export default Example;
👀 Props
Prop | Description | Type | Default |
---|---|---|---|
data |
Share Object | {text, url, title} |
{text: "", url: currentURL, title: "Share"} |
options |
sites | string[] |
all available social sites |
🤠 Credits
📜 License
MIT © harshzalavadiya