All Projects → Bunlong → next-share

Bunlong / next-share

Licence: MIT license
Social media share buttons for your next React apps.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to next-share

React Share
Social media share buttons and share counts for React
Stars: ✭ 1,978 (+1264.14%)
Mutual labels:  social-media, sharing
next-api-compose
🧬 Simple, dependency free, error aware and powerful utility to compose chain of multiple middleware into one Next.js API Route.
Stars: ✭ 22 (-84.83%)
Mutual labels:  next, nextjs-plugin
Simplesharingbuttons
Share to Facebook, Twitter, Google+ and other social networks using simple HTML buttons.
Stars: ✭ 147 (+1.38%)
Mutual labels:  social-media, sharing
next-api-og-image
Easy way to generate open-graph images dynamically in HTML or React using Next.js API Routes. Suitable for serverless environment.
Stars: ✭ 179 (+23.45%)
Mutual labels:  next, nextjs-plugin
ts-ui
Telar Social Network using Reactjs
Stars: ✭ 35 (-75.86%)
Mutual labels:  social-media, create-react-app
crud-app
❄️ A simple and beautiful CRUD application built with React.
Stars: ✭ 61 (-57.93%)
Mutual labels:  create-react-app
plexus
Plexus - Interactive Emotion Visualization based on Social Media
Stars: ✭ 27 (-81.38%)
Mutual labels:  social-media
stacker.news
It's like Hacker News but we pay you Bitcoin.
Stars: ✭ 196 (+35.17%)
Mutual labels:  next
speedy-math
An application which allows user (small kids) to practice basic Mathematics operations
Stars: ✭ 28 (-80.69%)
Mutual labels:  create-react-app
DoAnFullstack-ui
Currently on Offline mode for saving budget
Stars: ✭ 20 (-86.21%)
Mutual labels:  social-media
cra-monorepo-demo
Monorepo example using create-react-app and common component library structure with yarn workspaces
Stars: ✭ 37 (-74.48%)
Mutual labels:  create-react-app
plebpack
Webpack configuration for the common people.
Stars: ✭ 13 (-91.03%)
Mutual labels:  create-react-app
social
A simple social media using MEAN Stack. Frontend: Angular 6.
Stars: ✭ 13 (-91.03%)
Mutual labels:  social-media
website
Fully responsive website built with NextJS, React and Fluent UI, with the aim of providing services and access to all groups of didactic courses and general purposes to students of the University of Milan.
Stars: ✭ 29 (-80%)
Mutual labels:  next
webservices
Prestashop Web Services + React JS App
Stars: ✭ 34 (-76.55%)
Mutual labels:  create-react-app
react-deploy-s3
Deploy create react app's in AWS S3
Stars: ✭ 67 (-53.79%)
Mutual labels:  create-react-app
dtube
Decentralized video sharing & social media platform on Ethereum blockchain.
Stars: ✭ 70 (-51.72%)
Mutual labels:  social-media
media-library
An online media library application with React, Redux and redux-saga
Stars: ✭ 27 (-81.38%)
Mutual labels:  create-react-app
react-you-do-you
How I use React + Redux + Material-UI + TypeScript – you do you 💖
Stars: ✭ 103 (-28.97%)
Mutual labels:  create-react-app
shared-react-components-example
An example of a mono-repository of shared React components libraries!
Stars: ✭ 85 (-41.38%)
Mutual labels:  sharing

next-share

Social media share buttons for your next React apps.

downloads downloads

NPM npm bundle size Build Status JavaScript Style Guide

next-share

🎁 Features

  • No dependencies
  • Compatible with both JavaScript and TypeScript
  • Share buttons for your next React app
    • Facebook
    • Line
    • Pinterest
    • Reddit
    • Telegram
    • Tumblr
    • Twitter
    • Viber
    • Weibo
    • Whatsapp
    • Linkedin
    • VKShare
    • Livejournal
    • Workplace
    • Pocket
    • Instapaper
    • Hatena
    • FacebookMessenger
    • Email
    • Gab
  • Share counts
    • FacebookShareCount
    • HatenaShareCount
    • OKShareCount
    • PinterestShareCount
    • TumblrShareCount
    • VKShareCount

🔧 Install

next-share is available on npm. It can be installed with the following command:

npm install next-share --save

next-share is available on yarn as well. It can be installed with the following command:

yarn add next-share --save

💡 Usage of ShareButton

🎀 Facebook

👨‍💻 Code

import {
  FacebookShareButton,
  FacebookIcon,
} from 'next-share';

<FacebookShareButton
  url={'https://github.com/next-share'}
  quote={'next-share is a social share buttons for your next React apps.'}
  hashtag={'#nextshare'}
>
  <FacebookIcon size={32} round />
</FacebookShareButton>

📖 FacebookShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
quote string A quote to be shared.
hashtag string Hashtag to be shared.
windowWidth number 550 Opened window width.
windowHeight number 400 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

📖 FacebookIcon props

🎀 Line

👨‍💻 Code

import {
  LineShareButton,
  LineIcon,
} from 'next-share';

<LineShareButton
  url={'https://github.com/next-share'}
  title={'next-share is a social share buttons for your next React apps.'}
>
  <LineIcon />
</LineShareButton>

📖 LineShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
title string The title of the shared page.
windowWidth number 500 Opened window width.
windowHeight number 500 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

📖 LineIcon props

🎀 Pinterest

👨‍💻 Code

import {
  PinterestShareButton,
  PinterestIcon,
} from 'next-share'

<PinterestShareButton
  url={'https://github.com/next-share'}
  media={'next-share is a social share buttons for your next React apps.'}
>
  <PinterestIcon size={32} round />
</PinterestShareButton>

📖 PinterestShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
media string The image URL that will be pinned.
description string The description of the shared media.
windowWidth number 1000 Opened window width.
windowHeight number 730 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

📖 PinterestIcon props

🎀 Reddit

👨‍💻 Code

import {
  RedditShareButton,
  RedditIcon,
} from 'next-share'

<RedditShareButton
  url={'https://github.com/next-share'}
  title={'next-share is a social share buttons for your next React apps.'}
>
  <RedditIcon size={32} round />
</RedditShareButton>

📖 RedditShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
title string The title of the shared page.
windowWidth number 660 Opened window width.
windowHeight number 460 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

📖 RedditIcon props

🎀 Telegram

👨‍💻 Code

import {
  TelegramShareButton,
  TelegramIcon,
} from 'next-share'

<TelegramShareButton
  url={'https://github.com/next-share'}
  title={'next-share is a social share buttons for your next React apps.'}
>
  <TelegramIcon size={32} round />
</TelegramShareButton>

📖 TelegramShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
title string The title of the shared page.
windowWidth number 550 Opened window width.
windowHeight number 400 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

📖 TelegramIcon props

🎀 Tumblr

👨‍💻 Code

import {
  TumblrShareButton,
  TumblrIcon,
} from 'next-share'

<TumblrShareButton
  url={'https://github.com/next-share'}
  title={'next-share is a social share buttons for your next React apps.'}
>
  <TumblrIcon size={32} round />
</TumblrShareButton>

📖 TumblrShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
title string The title of the shared page.
tags Array<string>
caption string The description of the shared page.
posttype string link
windowWidth number 660 Opened window width.
windowHeight number 460 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

📖 TumblrIcon props

🎀 Twitter

👨‍💻 Code

import {
  TwitterShareButton,
  TwitterIcon,
} from 'next-share'

<TwitterShareButton
  url={'https://github.com/next-share'}
  title={'next-share is a social share buttons for your next React apps.'}
>
  <TwitterIcon size={32} round />
</TwitterShareButton>

📖 TwitterShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
title string The title of the shared page.
via string
hashtags array
related array
windowWidth number 550 Opened window width.
windowHeight number 400 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

📖 TwitterIcon props

🎀 Viber

👨‍💻 Code

import {
  ViberShareButton,
  ViberIcon,
} from 'next-share'

<ViberShareButton
  url={'https://github.com/next-share'}
  title={'next-share is a social share buttons for your next React apps.'}
>
  <ViberIcon size={32} round />
</ViberShareButton>

📖 ViberShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
title string The title of the shared page.
separator
windowWidth number 660 Opened window width.
windowHeight number 460 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

📖 ViberIcon props

🎀 Weibo

👨‍💻 Code

import {
  WeiboShareButton,
  WeiboIcon,
} from 'next-share'

<WeiboShareButton
  url={'https://github.com/next-share'}
  title={'next-share is a social share buttons for your next React apps.'}
  image={`${String(window.location)}/${example-image}`}
>
  <WeiboIcon size={32} round />
</WeiboShareButton>

📖 WeiboShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
title string The title of the shared page.
image string The image URL that will be shared.
windowWidth number 660 Opened window width.
windowHeight number 550 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

📖 WeiboIcon props

🎀 Whatsapp

👨‍💻 Code

import {
  WhatsappShareButton,
  WhatsappIcon,
} from 'next-share'

<WhatsappShareButton
  url={'https://github.com/next-share'}
  title={'next-share is a social share buttons for your next React apps.'}
  separator=":: "
>
  <WhatsappIcon size={32} round />
</WhatsappShareButton>

📖 WhatsappShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
title string The title of the shared page.
separator string
windowWidth number 550 Opened window width.
windowHeight number 400 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

📖 WhatsappIcon props

🎀 Linkedin

👨‍💻 Code

import {
  LinkedinShareButton,
  LinkedinIcon,
} from 'next-share'

<LinkedinShareButton url={'https://github.com/next-share'}>
  <LinkedinIcon size={32} round />
</LinkedinShareButton>

📖 LinkedinShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
windowWidth number 750 Opened window width.
windowHeight number 600 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

How do you use things like title, summary, etc.?

Use og tags in the <head> block of the HTML.

<meta property='og:image' content='' />
<meta property='og:title' content='' />
<meta property='og:description' content='' />

📖 LinkedinIcon props

🎀 VK

👨‍💻 Code

import {
  VKShareButton,
  VKIcon,
} from 'next-share'

<VKShareButton
  url={'https://github.com/next-share'}
  image={'./next-share.png'}
>
  <VKIcon size={32} round />
</VKShareButton>

📖 VKShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
title string The 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.
windowWidth number 660 Opened window width.
windowHeight number 460 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

📖 VKIcon props

🎀 Mailru

👨‍💻 Code

import {
  MailruShareButton,
  MailruIcon,
} from 'next-share'

<MailruShareButton
  url={'https://github.com/next-share'}
  title={'Next Share'}
>
  <MailruIcon size={32} round />
</MailruShareButton>

📖 MailruShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
title string The title of the shared page.
description string Description of the shared page.
imageUrl string Image url of the shared page.
windowWidth number 660 Opened window width.
windowHeight number 460 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

📖 MailruIcon props

🎀 Livejournal

👨‍💻 Code

import {
  LivejournalShareButton,
  LivejournalIcon,
} from 'next-share'

<LivejournalShareButton
  url={'https://github.com/next-share'}
  title={'Next Share'}
  description={'https://github.com/next-share'}
>
  <LivejournalIcon size={32} round />
</LivejournalShareButton>

📖 LivejournalShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
title string The title of the shared page.
description string Description of the shared page.
windowWidth number 660 Opened window width.
windowHeight number 460 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

📖 LivejournalIcon props

🎀 Workplace

👨‍💻 Code

import {
  WorkplaceShareButton,
  WorkplaceIcon,
} from 'next-share'

<WorkplaceShareButton
  url={'https://github.com/next-share'}
  quote={'Next Share'}
>
  <WorkplaceIcon size={32} round />
</WorkplaceShareButton>

📖 WorkplaceShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
quote string
hashtag string
windowWidth number 550 Opened window width.
windowHeight number 400 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

📖 WorkplaceIcon props

🎀 Pocket

👨‍💻 Code

import {
  PocketShareButton,
  PocketIcon,
} from 'next-share'

<PocketShareButton
  url={'https://github.com/next-share'}
  title={'Next Share'}
>
  <PocketIcon size={32} round />
</PocketShareButton>

📖 PocketShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
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.
windowWidth number 500 Opened window width.
windowHeight number 500 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

📖 PocketIcon props

🎀 Instapaper

👨‍💻 Code

import {
  InstapaperShareButton,
  InstapaperIcon,
} from 'next-share'

<InstapaperShareButton
  url={'https://github.com/next-share'}
  title={'Next Share'}
>
  <InstapaperIcon size={32} round />
</InstapaperShareButton>

📖 InstapaperShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
title string Title of the shared page.
description string Description of the shared page.
windowWidth number 500 Opened window width.
windowHeight number 500 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

📖 InstapaperIcon props

🎀 Hatena

👨‍💻 Code

import {
  HatenaShareButton,
  HatenaIcon,
} from 'next-share'

<HatenaShareButton
  url={'https://github.com/next-share'}
  title={'Next Share'}
>
  <HatenaIcon size={32} round />
</HatenaShareButton>

📖 HatenaShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
title string Title of the shared page.
windowWidth number 660 Opened window width.
windowHeight number 460 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

📖 HatenaIcon props

🎀 FacebookMessenger

👨‍💻 Code

import {
  FacebookMessengerShareButton,
  FacebookMessengerIcon,
} from 'next-share'

<FacebookMessengerShareButton
  url={'https://github.com/next-share'}
  appId={''}
>
  <FacebookMessengerIcon size={32} round />
</FacebookMessengerShareButton>

📖 FacebookMessengerShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
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.
windowWidth number 1000 Opened window width.
windowHeight number 820 Opened window height.
blankTarget boolean false Open share window in a new tab if set to true.

📖 FacebookMessengerIcon props

🎀 Email

👨‍💻 Code

import {
  EmailShareButton,
  EmailIcon,
} from 'next-share'

<EmailShareButton
  url={'https://github.com/next-share'}
  subject={'Next Share'}
  body="body"
>
  <EmailIcon size={32} round />
</EmailShareButton>

📖 EmailShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
subject string
body string
separator string
blankTarget boolean false Open share window in a new tab if set to true.

📖 EmailIcon props

🎀 Gab

👨‍💻 Code

import {
  GabShareButton,
  GabIcon,
} from 'next-share'

<GabShareButton
  url={'https://github.com/next-share'}
  title={'Next Share'}
>
  <GabIcon size={32} round />
</GabShareButton>

📖 GabShareButton props

Props Type Default Description Required
children node React component, HTML element or string.
url string The URL of the shared page.
title string Title of the shared page.
windowWidth number 660 Opened window width.
windowHeight number 640 Opened window height.

📖 GabIcon props

📚 Icons props

Props Type Default Description Required
size number Icon size in pixels.
round boolean Show round or rectangle.
borderRadius number Set rounded corners if using round icon.
bgStyle object Customize background style.
iconFillColor string white Customize icon fill color.
blankTarget boolean false Open share window in a new tab if set to true.

💡 Usage of ShareCount

👨‍💻 Code

import {
  FacebookShareCount,
  HatenaShareCount,
  OKShareCount,
  PinterestShareCount,
  TumblrShareCount,
  VKShareCount,
} from 'next-share';

<PinterestShareCount url={'https://github.com/next-share'} />

<PinterestShareCount url={'https://github.com/next-share'}>
  {shareCount => <span className="wrapper">{shareCount}</span>}
</PinterestShareCount>

<FacebookShareCount
  url={'https://github.com/next-share'}
  appId={''}
  appSecret={''}
/>

<FacebookShareCount
  url={'https://github.com/next-share'}
  appId={''}
  appSecret={''}
>
  {shareCount => <span className="wrapper">{shareCount}</span>}
</FacebookShareCount>

📖 FacebookShareCount props

Props Type Default Description Required
url string The URL of the shared page.
appId string Facebook application id.
appSecret string Facebook application secret.
children node React component, HTML element or string.

📜 Changelog

Latest version 0.19.0 (2022-10-17):

  • Add blankTarget props to open up a new tab

Details changes for each release are documented in the CHANGELOG.md.

💖 Wrap Up

If you think any of the next-share can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.

🌟 Contribution

We'd love to have your helping hand on contributions to next-share by forking and sending a pull request!

Your contributions are heartily ♡ welcome, recognized and appreciated. (✿◠‿◠)

How to contribute:

  • Open pull request with improvements
  • Discuss ideas in issues
  • Spread the word
  • Reach out with any feedback

Contributors

Bunlong
Bunlong
Arturs Kirtovskis
Arturs Kirtovskis
Sean
Sean
Steve Scavo
Steve Scavo
Maddy Miller
Maddy Miller

👨‍👩‍👦 Advertisement

You maybe interested.

  • React Patterns – React patterns & techniques to use in development for React Developer.
  • React Papaparse – The fastest in-browser CSV (or delimited text) parser for React.
  • Next QRCode – React hooks for generating QR code for your next React apps.
  • Next Time Ago – A lightweight tiny time-ago component for your next React apps.

⚖️ License

The MIT License License: MIT

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].