0.0.6 • Published 6 years ago

react-sociable v0.0.6

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

Simple social sharing buttons as react components.

For example:

import React from 'react';
import Sociable from 'react-sociable';

class Example extends React.Component {

  render() {

    const url = window.location.href;
    const msg = "Share it like you've never shared before!";

    return (
      <div>
         <Sociable.FacebookButton
            url={url}
            message={msg}
            windowOptions={["", "", "width=600,height=300"]}
            appId="233201753822876"
          >
            {'Facebook'}
          </Sociable.FacebookButton> 
         <Sociable.TwitterButton
            url={url}
            message={msg}
            windowOptions={["", "", "width=600,height=300"]}
          >
            {'Twitter'}
          </Sociable.TwitterButton> 
         <Sociable.EmailButton
            url={url}
            message={msg}
          >
            {'Email'}
          </Sociable.EmailButton> 
         <Sociable.PinterestButton
            url={url}
            message={msg}
            media="some/path/to/file"
          >
            {'Pinterest'}
          </Sociable.PinterestButton> 
         <Sociable.GooglePlusButton
            url={url}
          >
            {'Google Plus'}
          </Sociable.GooglePlusButton> 
      </div>
    )
  }
}

export default Example;

Credit

This module is heavily inspired by the react-social module. It takes a similar approach, opting for higher order components and ES2015 syntax rather than mixins. As such, it should be compatible with React 15.5 and up.

0.0.6

6 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago