Giter VIP home page Giter VIP logo

next-share's Introduction

next-share

next-share is a social share buttons plugin for Next.js, Create React App, Gatsby.js as well as React apps.

NPM downloads npm bundle size Build Status JavaScript Style Guide

next-share

๐ŸŽ Features

  • Compatible with both JavaScript and TypeScript
  • Next Share Buttons and Next Share Icons
    • Facebook
    • Line
    • Pinterest
    • Reddit
    • Telegram
    • Tumblr
    • Twitter
    • Viber
    • Weibo
    • Whatsapp

๐Ÿ”ง 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

๐Ÿ’ก Usage

๐ŸŽ€ Facebook

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

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

๐ŸŽ€ Line

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

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

๐ŸŽ€ Pinterest

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

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

๐ŸŽ€ Reddit

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

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

๐ŸŽ€ Telegram

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

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

๐ŸŽ€ Telegram

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

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

๐ŸŽ€ Twitter

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

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

๐ŸŽ€ Viber

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

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

๐ŸŽ€ Weibo

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

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

๐ŸŽ€ Whatsapp

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

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

๐Ÿ“š Icons Documentation

๐Ÿ“– Icons Props

Props Type Default Description Required
size number Icon size in pixels. โŒ
round boolean false 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. โŒ

๐Ÿ“š ShareButtons Documentation

๐Ÿ“– FacebookShareButton Props

Props Type Default Description Required
children React node React component, HTML element or string. โœ…
url string The URL of the shared page. โœ…
quote string A quote to be shared. โŒ
hashtag string โŒ
windowWidth number 550 Opened window width. โŒ
windowHeight number 400 Opened window height. โŒ

๐Ÿ“– LineShareButton Props

Props Type Default Description Required
children React 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. โŒ

๐Ÿ“– PinterestShareButton Props

Props Type Default Description Required
children React 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 550 Opened window width. โŒ
windowHeight number 400 Opened window height. โŒ

๐Ÿ“– RedditShareButton Props

Props Type Default Description Required
children React 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. โŒ

๐Ÿ“– TelegramShareButton Props

Props Type Default Description Required
children React 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. โŒ

๐Ÿ“– TumblrShareButton Props

Props Type Default Description Required
children React 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. โŒ

๐Ÿ“– TwitterShareButton Props

Props Type Default Description Required
children React 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. โŒ

๐Ÿ“– ViberShareButton Props

Props Type Default Description Required
children React 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 660 Opened window width. โŒ
windowHeight number 460 Opened window height. โŒ

๐Ÿ“– WeiboShareButton Props

Props Type Default Description Required
children React 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. โŒ

๐Ÿ“– WhatsappShareButton Props

Props Type Default Description Required
children React 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. โŒ

๐Ÿ’– 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

โš–๏ธ License

The MIT License License: MIT

next-share's People

Contributors

bunlong avatar helloitsm3 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.