material-ui-share

0.1.1 • Public • Published

Material Share

JavaScript Style Guide Build Status Greenkeeper badge

Example Alt text

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

other browsers will follow

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.

Package Sidebar

Install

npm i material-ui-share

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • redbeard0091
  • lemaik
  • saschb2b
  • evidence