Tiny Web Share API Wrapper with fallback for unsupported browsers
npm install react-web-shareTiny Web Share API wrapper with fallback for unsupported browsers




> 💡 most browsers restricts web share api only to https websites
- 🍃 Only ~6kb gzipped and no external dependencies
- 🌀 Uses React Portal
- ✌ Written w/ TypeScript
``bash`
npm i react-web-share # npm
yarn add react-web-share # yarn
`tsx
import React, { useState } from "react";
import { RWebShare } from "react-web-share";
const Example = () => {
return (
export default Example;
`
| 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` |
- facebook
- twitter
- whatsapp
- reddit
- telegram
- linkedin
- mail
- copy (Copy to Clipboard)
- vk
- okru
MIT © harshzalavadiya