# tons613-react-sharingbuttons

> Lightweight social sharing buttons for React.

Latest version **1.0.6** (published 2020-10-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install tons613-react-sharingbuttons
pnpm add tons613-react-sharingbuttons
yarn add tons613-react-sharingbuttons
bun add tons613-react-sharingbuttons
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2020-10-28 |
| First published | 2020-10-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 38.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Forked by tony from: Kacper Golinski |
| Maintainers | tons613 |
| Keywords | react, react-component, social-buttons, sharing-buttons |

## Links

- npm: https://www.npmjs.com/package/tons613-react-sharingbuttons
- Repository: https://github.com/tons613/react-sharingbuttons
- Issues: https://github.com/tons613/react-sharingbuttons/issues
- npm.io page: https://npm.io/package/tons613-react-sharingbuttons

## Dependencies (2)

- [prop-types](https://npm.io/package/prop-types.md) ^15.6.2
- [style-loader](https://npm.io/package/style-loader.md) ^0.23.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2020-10-28
- 1.0.5 — 2020-10-28
- 1.0.4 — 2020-10-28
- 1.0.3 — 2020-10-28
- 1.0.2 — 2020-10-28
- 1.0.1 — 2020-10-28
- 1.0.0 — 2020-10-28

## README

# react-sharingbuttons

Lightweight social sharing buttons for React. No tracking. Just fun. Heavily inspired by [sharingbuttons.io](http://sharingbuttons.io)

# Demo & Docs:

https://caspg.github.io/react-sharingbuttons

# Installation

```bash
  yarn add tons613-react-sharingbuttons
```

or alternatively:

```bash
npm install --save tons613-react-sharingbuttons
```

# Usage

```javascript
import { Facebook, Twitter } from "tons613-react-sharingbuttons";
```

**NOTE**
If you care about your bundle size, you can import each button separately.

```javascript
import Facebook from "react-sharingbuttons/dist/buttons/Facebook";
import Twitter from "react-sharingbuttons/dist/buttons/Twitter";
```

Import predefined css:

```javascript
import "react-sharingbuttons/dist/main.css";
```

```javascript
const sharingButtons = () => {
  const url = "https://github.com/caspg/react-sharingbuttons";
  const shareText = "Check this site!";

  return (
    <div>
      <Facebook url={url} />
      <Twitter url={url} shareText={shareText} />
    </div>
  );
};
```

[See the example](https://github.com/caspg/react-sharingbuttons/blob/master/www/components/SharingButtons.jsx#L15)

# Overriding styles

You can customize buttons further to meet your needs. For example, following html will be rendered for `Twitter` button:

```html
<a
  href="https://your.website"
  class="react-sharing-button__link react-sharing-button--twitter"
>
  <svg class="react-sharing-button__icon">...</svg>
  <span class="react-sharing-button__text">Share me</span>
</a>
```

# Available buttons and its props

**common props:**

- `text` - text which is displayed inside button, default to button name.
- `onClick` - onClick event passed to `a` tag.

**button specific props:**

|               |                                                            |
| ------------- | ---------------------------------------------------------- |
| **Email**     | `text`, `url`, `subject`                                   |
| **Facebook**  | `text`, `url`                                              |
| **Google**    | `text`, `url`                                              |
| **Pinterest** | `text`, `url`, `shareText` (a pin description), `mediaSrc` |
| **Reddit**    | `text`, `url`                                              |
| **Twitter**   | `text`, `url`, `shareText` (a tweet text),                 |
| **LinkedIn**  | `text`, `url`, `shareText` (a tweet text),                 |
| **Tumblr**    | `text`, `url`, `title`, `caption`, `content`               |
| **WhatsApp**  | `text`, `url`, `message` (message text),                   |
| **Telegram**  | `text`, `url`, `message` (message text),                   |

---
_Source: https://npm.io/package/tons613-react-sharingbuttons · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
