2.0.2 • Published 3 years ago
react-web-share v2.0.2
react-web-share
Tiny Web Share API wrapper with fallback for unsupported browsers
💡 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
Desktop
📦 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
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 |
🌎 Sites
- telegram
- copy (Copy to Clipboard)
- vk
- okru
📜 License
MIT © harshzalavadiya
2.0.2
3 years ago
2.0.1
3 years ago
2.0.0
3 years ago
1.1.6
3 years ago
1.1.5
3 years ago
1.1.4
3 years ago
1.1.1
3 years ago
1.1.3
3 years ago
1.1.2
3 years ago
1.1.0
4 years ago
1.0.18-alpha.2
4 years ago
1.0.18
4 years ago
1.0.18-alpha.1
4 years ago
1.0.18-alpha
4 years ago
1.0.1-7.alpha
4 years ago
1.0.16
4 years ago
1.0.15
4 years ago
1.0.14
4 years ago
1.0.13
5 years ago
1.0.11-alpha
5 years ago
1.0.12
5 years ago
1.0.10-alpha
5 years ago
1.0.9
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago
0.1.3-alpha
5 years ago
0.1.2-alpha
5 years ago
0.1.1-alpha
5 years ago
0.1.0-alpha
5 years ago