2.0.2 • Published 2 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
2 years ago
2.0.1
2 years ago
2.0.0
2 years ago
1.1.6
2 years ago
1.1.5
2 years ago
1.1.4
2 years ago
1.1.1
2 years ago
1.1.3
2 years ago
1.1.2
2 years ago
1.1.0
3 years ago
1.0.18-alpha.2
3 years ago
1.0.18
3 years ago
1.0.18-alpha.1
3 years ago
1.0.18-alpha
3 years ago
1.0.1-7.alpha
3 years ago
1.0.16
3 years ago
1.0.15
3 years ago
1.0.14
3 years ago
1.0.13
4 years ago
1.0.11-alpha
4 years ago
1.0.12
4 years ago
1.0.10-alpha
4 years ago
1.0.9
4 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago
0.1.3-alpha
4 years ago
0.1.2-alpha
4 years ago
0.1.1-alpha
4 years ago
0.1.0-alpha
4 years ago