1.0.1 • Published 6 years ago

react-web-share-button v1.0.1

Weekly downloads
57
License
MIT
Repository
github
Last release
6 years ago

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:

NameDescription
buttonTextText or Node that is used on the Share button
buttonStyleInline styles for the Button
fallbackContainerStylesInline styles for the fallback container
fallbackContainerOnShowStylesInline styles for the fallback container when it becames visible
targetWhere to open url in case of the fallback dialog
fallbackButtonStyleInline styles for the fallback buttons
urlUrl to share
onSuccessCalled when the share is successful, only in case where Web Share API is supported
onErrorCalled when the share is not successful, only in case where Web Share API is supported
textText that is used by the Web Share API
titleTitle that is used by the Web Share API