1.0.6 • Published 5 years ago

react-simple-social v1.0.6

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

Add social share links through one simple and lightweight React component

A simple React component that adds React share links with SVG icons in your selected color. You don't have to add an <Twittershare /> <FacebookShare /> <RedditShare />... for each service you want to share to. Instead you add the react-simple-social component once: <SocialShare sites={['facebook', 'twitter', 'reddit', 'linkedin', 'email']} /> and specify which share links it shall contain as a prop. And its lightweight and should work with React version 15 and 16.

It contains 5 inline SVG icon types; minimal, round, roundedunfilled, roundedsquare, square and text. These can be passed as props to the component. They look like and are all taken from iconmonstr.com:

icons

Usage

Install the package running:

npm i react-simple-social

Or

yarn add react-simple-social

Then use it in your React component:

import React, { Component } from 'react';

import SocialShare from 'react-simple-social';

export class MyComponent extends Component {
  render() {
    return (
      <div>
        Hello world!
        <SocialShare 
          url="https://example.com/my-blog-post"
          title="This is my blog post"
          sites={['facebook', 'twitter', 'reddit', 'linkedin', 'email']}
          color='gray'
          width="20"
          height="20"
          theme="minimal"
        />
      </div>
    );
  }
}

You can configure the following props:

PropValue
urlfull url to share (required)
titletitle of the shared content (only used on some sites)
siteswanted share icons, possibilities: sites={'facebook', 'twitter', 'reddit', 'linkedin', 'email'}
heightheight of the icon
widthwidth of the icon
colorcolor of the icon
themewhich of the icon theme to use (or raw text) possibilities: minimal, round, roundedunfilled, roundedsquare, square, text

Thanks

Icons are from: http://iconmonstr.com

Build using boilerplate: https://github.com/lassegit/npm-react-module

1.0.6

5 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago