npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ta-react-share-buttons

v1.0.2

Published

Renders a collection of social sharing buttons.

Downloads

7

Readme

Modules

Classes

Members

Constants

Functions

ShareButtons/displayTypes

List possible display types

ShareButtons

Renders a collection of social sharing buttons.

Version: 1.0

ShareButtons/supportedCommunities

List supported communities

ShareButtons

Kind: global class

new ShareButtons(props)

Renders social sharing buttons.

| Param | Type | Description | | --- | --- | --- | | props | Object | See ShareButtons.propTypes |

default

The communities this setup currently supports (i.e. with icons or the shareActionFactory.

Kind: global variable

HORIZONTAL_ICONS : enum

Virtual enums – used to define the different forms a sharing button/icon can take when being shown.

Kind: global enum
Read only: true

minimumShares : number

Share count number is only being shown if greater than this constant.

Kind: global constant

ShareItem() ⇒ XML

A share item is a single sharing item, consisting of a link with an icon. Using display types, this item can be displayed in different ways, either as a list item or as a button.

Kind: global function

| Param | Type | Description | | --- | --- | --- | | props.displayType | string | Either {@see HORIZONTAL_ICONS} or {@see VERTICAL_BUTTONS}. | | props.inverted | boolean | If share items should be shown inverted. | | props.type | string | Can currently be facebook or twitter. | | props.count | number | Number of shares, if available. | | props.description | string | Description – used as activator («Auf Twitter teilen») | | props.shareUrl | string | The action URL that should be opened when clicking the button link. |

Renders a collection of social sharing buttons.

Installation

yarn add ta-react-share-buttons

Usage

import ShareButtons, * as shareButtonsSupportLibrary from 'ta-react-share-buttons';

//...

class YourComponent extends React.Component {
  render() {

    return (
      <ShareButtons
          hashtags={['TAGrafik', 'ddj']}
          displayType={shareButtonsSupportLibrary.HORIZONTAL_ICONS}/>
    )
  }
}

Remarks

Display Type

Currently available values:

  • 'horizontal icons'
  • 'vertical buttons'

To simplify working with these values, you can use the enums defined in the module. See Usage for an example of how to do that.

Communities

The default communities are these:

[
  {
    type: 'twitter',
    description: 'Bei Twitter veröffentlichen',
    count: 0
  },
  {
    type: 'facebook',
    description: 'Über Facebook teilen',
    facebook_id: 147124108642216,
    count: 0
  }
]

Community objects need at least a type property to work.

Currently supported community types are

  • twitter
  • facebook

The communities property is modeled after the Newsnet Sharing API, so that the response of that API can easily be dumped into this component.