React Share Button Component that uses the Web Share API with fallback
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
src
.babelrc
.eslintrc.js
.gitignore
LICENSE
README.md
package.json
screenshot_not_supported.png
screenshot_support.png
yarn.lock

README.md

react-web-share-button

React Share Button Component that uses the Web Share API with fallback

forthebadge

NPM

Demo

Edit r439xy43zm

How to use it:

import ShareButton from 'react-web-share-button';

<ShareButton title="My Great Page" text="A really great page" url="http://www.greatpage.com" />

Browsers with Web Share API support

Browsers without Web Share API support

Options:

Name Description
buttonText Text or Node that is used on the Share button
buttonStyle Inline styles for the Button
fallbackContainerStyles Inline styles for the fallback container
fallbackContainerOnShowStyles Inline styles for the fallback container when it becames visible
target Where to open url in case of the fallback dialog
fallbackButtonStyle Inline styles for the fallback buttons
url Url to share
onSuccess Called when the share is successful, only in case where Web Share API is supported
onError Called when the share is not successful, only in case where Web Share API is supported
text Text that is used by the Web Share API
title Title that is used by the Web Share API