material-ui-share
v0.1.1 react material material-design material-ui share react-component
Material Share
With chrome 61 on mobile the Web Share Api was deployed. You can now invoke the native share action inside your browser. You can read more about here
To use the Web Share Api:
- you must be served over HTTPS
- you can also share any URL, not just URLs under your website's current scope: and you may also share text without a URL
- you should feature-detect it in case it's not available on your users' platform (e.g., via
navigator.share !== undefined
)
Installation
npm i --save material-ui-share
Usage
import Share from 'material-ui-share'
// ...
render() {
return(
<Share
title='This is a cool title'
text='Oh you want some text for this share component'
url='https://developers.google.com/web/updates/2016/09/navigator-share'
/>
)
}
SearchBar Properties
Name | Type | Default | Description |
---|---|---|---|
title | string |
Sets title for content to share. | |
text | string |
Sets text for content to share. | |
url | string |
Sets url for content to share. | |
onFailure | func |
Fired when share action returns an error. | |
onSuccess | func |
Fired when share action succeeded. | |
style | object |
Override the inline-styles of the root element. |
* required property
License
The files included in this repository are licensed under the MIT license.