All Projects → nygardk → React Share

nygardk / React Share

Licence: mit
Social media share buttons and share counts for React

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Share

Simplesharingbuttons
Share to Facebook, Twitter, Google+ and other social networks using simple HTML buttons.
Stars: ✭ 147 (-92.57%)
Mutual labels:  sharing, social-media
shared-react-components-example
An example of a mono-repository of shared React components libraries!
Stars: ✭ 85 (-95.7%)
Mutual labels:  react-component, sharing
next-share
Social media share buttons for your next React apps.
Stars: ✭ 145 (-92.67%)
Mutual labels:  social-media, sharing
React Lazy
Universal lazy loader components using IntersectionObserver for React
Stars: ✭ 118 (-94.03%)
Mutual labels:  react-component
React Native Fading Slides
➰ Simple looped fading slides carousel for React Native.
Stars: ✭ 123 (-93.78%)
Mutual labels:  react-component
Sfm Ui
Social Feed Manager user interface application.
Stars: ✭ 129 (-93.48%)
Mutual labels:  social-media
Create React Component Folder
Creates react component folder structure
Stars: ✭ 139 (-92.97%)
Mutual labels:  react-component
Warp
Secure and simple terminal sharing
Stars: ✭ 1,548 (-21.74%)
Mutual labels:  sharing
Antd Schema Form
Based on Ant Design, interactive forms can be generated through JSON Schema configuration. - 基于Ant Design,可以通过JSON Schema配置生成可交互的表单。
Stars: ✭ 137 (-93.07%)
Mutual labels:  react-component
Curatedseotools
Best SEO Tools Stash
Stars: ✭ 128 (-93.53%)
Mutual labels:  social-media
Xray React
React layout debugger.
Stars: ✭ 128 (-93.53%)
Mutual labels:  react-component
React Ckeditor
CKEditor component for React with plugin and custom event listeners support
Stars: ✭ 124 (-93.73%)
Mutual labels:  react-component
Reddit Detective
Play detective on Reddit: Discover political disinformation campaigns, secret influencers and more
Stars: ✭ 129 (-93.48%)
Mutual labels:  social-media
React Structured Data
React Structured Data provides an easy way to add structured data to your React apps
Stars: ✭ 120 (-93.93%)
Mutual labels:  react-component
Personal Security Checklist
🔒 A curated checklist of 300+ tips for protecting digital security and privacy in 2021
Stars: ✭ 2,388 (+20.73%)
Mutual labels:  social-media
React Audio Recorder
A React Component using the Web Audio API to record, save, and play audio.
Stars: ✭ 118 (-94.03%)
Mutual labels:  react-component
React Sizeme
Make your React Components aware of their width and height!
Stars: ✭ 1,770 (-10.52%)
Mutual labels:  react-component
React Native Keyboard Accessory View
Keyboard accessory (sticky) view for your React Native app. Supports interactive dismiss on iOS.
Stars: ✭ 128 (-93.53%)
Mutual labels:  react-component
React Splitters
React splitter component, written in TypeScript.
Stars: ✭ 127 (-93.58%)
Mutual labels:  react-component
React Responsive Carousel
React.js Responsive Carousel (with Swipe)
Stars: ✭ 1,962 (-0.81%)
Mutual labels:  react-component

react-share

npm version Download Count

Social media share buttons and share counts for React.

Share buttons and counts example

Migrating from v2 to v3? Read changelog.

Migrating from v1 to v2? Read migration notes.

Features

  • no external script loading, i.e. no dependencies on SDKs
  • opens a popup share-window
  • share buttons for:
    • Facebook
    • Facebook Messenger
    • Twitter
    • Telegram
    • Whatsapp
    • LinkedIn
    • Pinterest
    • VK
    • Odnoklassniki
    • Reddit
    • Tumblr
    • Mail.Ru
    • LiveJournal
    • Viber
    • Workplace
    • Line
    • Weibo
    • Pocket
    • Instapaper
    • Hatena
    • email
  • share counts for
    • Facebook
    • Pinterest
    • VK
    • Odnoklassniki
    • Reddit
    • Tumblr
    • Hatena
  • social media icons included in the library
  • supports also custom icons

Demo

View demo

To run demo: clone repo and run npm install && npm run run-demos and open http://localhost:8080.

Install

npm install react-share --save

Compatibility

Version 1.x.x: compatible with React versions 0.13.x, 0.14.x and 15.x.x.

Version 2.x.x: compatiblity is tested with React 15 and 16.

Version 3.x.x: compatiblity is tested with React 15 and 16.

Version 3.0.1: compatible with React ^16.3.

Version 4.x.x: compatible with React >=16.3.

API

Share buttons

import {
  EmailShareButton,
  FacebookShareButton,
  HatenaShareButton,
  InstapaperShareButton,
  LineShareButton,
  LinkedinShareButton,
  LivejournalShareButton,
  MailruShareButton,
  OKShareButton,
  PinterestShareButton,
  PocketShareButton,
  RedditShareButton,
  TelegramShareButton,
  TumblrShareButton,
  TwitterShareButton,
  ViberShareButton,
  VKShareButton,
  WhatsappShareButton,
  WorkplaceShareButton
} from "react-share";
Share button props
Required props Optional props
All children (string/element): React node
url (string): URL of the shared page
disabled (bool): Disables click action and adds "disabled" class
disabledStyle (object, default={ opacity: 0.6 }): Disabled style
windowWidth, windowHeight (number, different default for all share buttons): opened window dimensions
beforeOnClick (() => Promise/() => void): Takes a function that returns a Promise to be fulfilled before calling onClick. If you do not return promise, onClick is called immediately.
openShareDialogOnClick (boolean): Open dialog on click. Defaults to true except on EmailShareButton
onShareWindowClose (() => void): Takes a function to be called after closing share dialog.
resetButtonStyle (boolean, default=true): Reset button element style. Preferred to be set to false if you want to customize the button style.
EmailShareButton - subject (string): Title of the shared page
body (string): Email, will be prepended to the url.
separator (string, default=" "): Separates body from the url
FacebookShareButton - quote (string): A quote to be shared along with the link.
hashtag (string): A hashtag specified by the developer to be added to the shared content. People will still have the opportunity to remove this hashtag in the dialog. The hashtag should include the hash symbol.
FacebookMessengerShareButton appId (string): Facebook application id redirectUri (string): The URL to redirect to after sharing (default: the shared url).
to (string): A user ID of a recipient. Once the dialog comes up, the sender can specify additional people as recipients.
HatenaShareButton - title (string): Title of the shared page
InstapaperShareButton - title (string): Title of the shared page
description (string): Description of the shared page
LinkedinShareButton - title (string): Title of the shared page
summary (string): Description of the shared page
source (string): Source of the content (e.g. your website or application name)
LineShareButton - title (string): Title of the shared page
LivejournalShareButton - title (string): Title of the shared page
description (string): Description of the shared page
MailruShareButton - title (string): Title of the shared page
description (string): Description of the shared page
imageUrl (string): An absolute link to the image that will be shared
OKShareButton - title (string): Title of the shared page
description (string): Description of the shared page
image (string): An absolute link to the image that will be shared
PinterestShareButton media (string): An absolute link to the image that will be pinned description (string): Description for the shared media.
PocketShareButton - title (string): Title of the shared page. Note that if Pocket detects a title tag on the page being saved, this parameter will be ignored and the title tag of the saved page will be used instead.
RedditShareButton - title (string): Title of the shared page
TelegramShareButton - title (string): Title of the shared page
TumblrShareButton - title (string): Title of the shared page
tags: (Array<string>)
caption (string): Description of the shared page
posttype (string, default=link)
TwitterShareButton - title (string): Title of the shared page
via: (string)
hashtags (array): Hashtags
related (array): Accounts to recommend following
ViberShareButton - title (string): Title of the shared page
separator (string), default=" ": Separates title from the url
VKShareButton - title (string): Title of the shared page
image (string): An absolute link to the image that will be shared
noParse (boolean): If true is passed, VK will not retrieve URL information
noVkLinks (boolean): If true is passed, there will be no links to the user's profile in the open window. Only for mobile devices
WeiboShareButton - title (string): Title of the shared page
image (string): An absolute link to the image that will be shared
WhatsappShareButton - title (string): Title of the shared page
separator (string, default=" "): Separates title from the url
WorkplaceShareButton - quote (string): A quote to be shared along with the link.
hashtag (string): A hashtag specified by the developer to be added to the shared content. People will still have the opportunity to remove this hashtag in the dialog. The hashtag should include the hash symbol.

Share counts

import {
  FacebookShareCount,
  HatenaShareCount,
  OKShareCount,
  PinterestShareCount,
  RedditShareCount,
  TumblrShareCount,
  VKShareCount
} from "react-share";

All share count components take in only one mandatory prop: url, which is the URL you are sharing. className prop is optional.

Example:

<FacebookShareCount url={shareUrl} />

If you want to render anything else but the count, you can provide a function as a child element that takes in shareCount as an argument and returns an element:

<FacebookShareCount url={shareUrl}>
  {shareCount => <span className="myShareCountWrapper">{shareCount}</span>}
</FacebookShareCount>

Icons

import {
  EmailIcon,
  FacebookIcon,
  FacebookMessengerIcon,
  HatenaIcon,
  InstapaperIcon,
  LineIcon,
  LinkedinIcon,
  LivejournalIcon,
  MailruIcon,
  OKIcon,
  PinterestIcon,
  PocketIcon,
  RedditIcon,
  TelegramIcon,
  TumblrIcon,
  TwitterIcon,
  ViberIcon,
  VKIcon,
  WeiboIcon,
  WhatsappIcon,
  WorkplaceIcon
} from "react-share";

Props:

  • size: Icon size in pixels (number)

  • round: Whether to show round or rect icons (bool)

  • borderRadius: Allow rounded corners if using rect icons (number)

  • bgStyle: customize background style, e.g. fill (object)

  • iconFillColor: customize icon fill color (string, default = 'white')

Example:

<TwitterIcon size={32} round={true} />

About semantic versioning

This library uses the standard semver convention. However, the share buttons and and counts are prone to lots of changes that are not in control of this library. For example: if Facebook decides to change or deprecate it's API in a major way, this library will not get a major version bump just because of that. Keep this in mind when you are planning the maintenance of your application.

License

MIT

Icons

Icon paths provided by: react-social-icons.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].