Giter Site home page Giter Site logo

next-social-sharer's Introduction

next-social-sharer

Social media share buttons for your next React apps.

๐ŸŽ 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

๐Ÿ’ก Usage

๐ŸŽ€ 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. โŒ

๐ŸŽ€ 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. โŒ

๐Ÿ“– 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. โŒ

๐ŸŽ€ 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. โŒ

๐ŸŽ€ 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. โŒ

๐ŸŽ€ 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. โŒ

๐ŸŽ€ 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. โŒ

๐ŸŽ€ 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. โŒ

๐Ÿ“– 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. โŒ

๐Ÿ“– 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. โŒ

๐ŸŽ€ 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. โœ…
title string The 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). โŒ
windowWidth number 750 Opened window width. โŒ
windowHeight number 600 Opened window height. โŒ

๐ŸŽ€ 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. โŒ

๐Ÿ“– 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. โŒ

๐ŸŽ€ 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. โŒ

๐ŸŽ€ 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. โŒ

๐ŸŽ€ 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. โŒ

๐ŸŽ€ 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. โŒ

๐ŸŽ€ 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. โŒ

๐ŸŽ€ 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. โŒ

๐ŸŽ€ 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 โŒ

๐Ÿ“– EmailIcon 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. โŒ

๐Ÿ“œ Changelog

Changes in each release are documented in the CHANGELOG.md.

โš–๏ธ License

The MIT License License: MIT

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.