Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-social-btn

Package Overview
Dependencies
Maintainers
3
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-social-btn

Buttons Share on social networks with the number of users to rate for React.

  • 1.2.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
3
Weekly downloads
 
Created
Source

react-social-btn

Buttons "Share" on social networks with the number of users to rate for React.

NPM JavaScript Style Guide

Install

This package requires node >= 4, but we recommend node >= 8.

yarn add react-social-btn

Usage

import React from 'react';

import {ShareButton, SocialList} from 'react-social-btn';

const Example = () => {
    const list = [
        {
            name: 'vk',
            textButton: 'Vkontakte',
            utm: '?utm' //optional
        },
        {
            name: 'mail',
            textButton: 'My@Mail.ru',
            utm: '?utm' //optional
        },
        {
            name: 'ok',
            textButton: 'Odnoklassniki',
            utm: '?utm' //optional
        },
        {
            name: 'facebook',
            textButton: 'Facebook',
            utm: '?utm' //optional
        },
        {
            name: 'twitter',
            textButton: 'Twitter',
            utm: '?utm' //optional
        },
        {
            name: 'telegram',
            extButton: 'Telegram',
            utm: '?utm' //optional
        },
        {
            name: 'copy',
            extButton: 'Copy link',
            utm: '?utm', //optional
            onClick: () => {
            	console.log('Link copied')
            } //optional
        }
    ];
 
    return (
        <>
            <ShareButton
                title="Share"
                style={{
                    marginBottom: '1em'
                }}
                className="share"
                toCount={true}
                list={list}
                defaultUrl="https://zaycev.net"
                callback={() => console.log('Share click')}
            />
            <SocialList
                style={{
                    marginBottom: '1em'
                }}
                className="share-list"
                list={list}
                toCount={true}
                defaultUrl="https://zaycev.net"
            />
        </>
    );
};

Props

ShareButton
Name propsDefaultOptional propsDescription
titleПоделитьсяTitle button
styleOther styles from Button
classNameExtra className from Button
toCounttruetrue/falseEnabled/Disabled count social share
listAll socialarrayList name and title button
defaultUrlDefault Url
callbackCallback from button click
SocialList
Name propsDefaultOptional propsDescription
styleOther styles from Button
classNameExtra className from Button
toCounttruetrue/falseEnabled/Disabled count social share
listAll socialarrayList name and title button
defaultUrlDefault Url

License

MIT © Zaycev.net

FAQs

Package last updated on 12 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc