Social media share buttons for React, Nextjs and PReact applications.
npm install react-share-litebash
npm install react-share-lite
`
or
`bash
yarn add react-share-lite
`
š Share Button Global Props
Each button supports a set of global props that are consistent across all buttons. However, in addition to these global props, each button also possesses its own unique set of specific properties. These specific properties are tailored to the individual functionality and customization options of each button.
| Props | Type | Default | Description | Required |
| :----------- | :------ | :------------ | :------------------------------------------------------------------------------------------------ | :------- |
| url | string | | The URL of the shared page. | TRUE |
| title | string | | The title of the shared page. | FALSE |
| windowWidth | number | 550 | Opened window width. | FALSE |
| windowHeight | number | 400 | Opened window height. | FALSE |
| blankTarget | boolean | false | Open share window in a new tab if set to true. | FALSE |
| bgColor | string | related color | Icon background color. | FALSE |
| round | boolean | false | The "round" attribute creates a fully circular button shape, giving it a 100% rounded appearance. | FALSE |
| borderRadius | number | 0px | Custom round share. | FALSE |
| size | number | 64px | The button size. | FALSE |
| buttonTitle | string | | The title of button used instead of icon. | FALSE |
šØāš» Example
`jsx
import React from 'react'
import { FacebookShare } from 'react-share-lite'
const ShareButtons = () => {
const shareUrl = 'https://github.com/ayda-tech/react-share-lite'
const title = 'Check out this awesome website!'
return
}
`
š” Usage of ShareButtons
$3
šØāš» Example
`js
import { FacebookShare } from 'react-share-lite';
url={'https://github.com/ayda-tech/react-share-lite'}
quote={'react-share-lite - social share buttons for next & react apps.'}
hashtag={'#react-share-lite'}
/>
`
š Props: Supports only on Facebook
| Props | Type | Default | Description | Required |
| :------ | :----- | :------ | :-------------------- | :------- |
| quote | string | | A quote to be shared. | FALSE |
| hashtag | string | | Hashtag to be shared. | FALSE |
$3
šØāš» Example
`js
import {
TwitterShare
} from 'react-share-lite'
url={'https://github.com/ayda-tech/react-share-lite'}
title={'react-share-lite - social share buttons for next & react apps.'}
hashtags=["#react-share-lite", "#front-end"]
/>
`
š Props: Supports only on Twitter
| Props | Type | Default | Description | Required |
| :------- | :----- | :------ | :---------- | :------- |
| via | string | | A screen name to associate with the Tweet. | FALSE |
| hashtags | array | | A comma-separated list of hashtags to be appended to default Tweet text. | FALSE |
| related | array | | A comma-separated list of accounts related to the content of the shared URI. | FALSE |
$3
šØāš» Example
`js
import { LinkedinShare } from 'react-share-lite'
`
$3
šØāš» Example
`js
import { WhatsappShare } from 'react-share-lite'
url={'https://github.com/ayda-tech/react-share-lite'}
title={'react-share-lite - social share buttons for next & react apps.'}
separator=":: "
/>
`
š Props: Supports only on WhatsApp
| Props | Type | Default | Description | Required |
| :-------- | :----- | :------ | :---------- | :------- |
| separator | string | | | FALSE |
$3
šØāš» Example
`js
import { TelegramShare } from 'react-share-lite'
`
$3
šØāš» Example
`js
import { FacebookMessengerShareButton } from 'react-share-lite'
url="https://github.com/ayda-tech/react-share-lite"
redirectUri="https://github.com/ayda-tech/react-share-lite"
appId={'dmm4kj9djk203k4liuf994p'}
/>
`
š Props: Supports only on Facebook Messenger
| Props | Type | Default | Description | Required |
| :---------- | :----- | :------ | :---------------------------------------------------------------------------------------------------------- | :------- |
| appId | string | | Facebook application id. | TRUE |
| redirectUri | string | | The URL to redirect to after sharing (default: the shared url). | FALSE |
| to | string | | A user ID of a recipient. Once the dialog comes up, the sender can specify additional people as recipients. | FALSE |
$3
šØāš» Example
`js
import { EmailShare } from 'next-share'
url={'https://github.com/next-share'}
subject={'Next Share'}
body="body"
/>
`
š Props: Supports only on Email
| Props | Type | Default | Description | Required |
| :---------- | :------ | :------ | :----------------------------------------------- | :------- |
| children | node | | React component, HTML element or string. | TRUE |
| url | string | | The URL of the shared page. | TRUE |
| subject | string | | The subject of the email. | FALSE |
| body | string | | The body of the email. | FALSE |
| separator | string | | A separator to be shared. | FALSE |
| blankTarget | boolean | false | Open share window in a new tab if set to true. | FALSE |
$3
šØāš» Example
`js
import { VKShare } from 'react-share-lite'
url={'https://github.com/ayda-tech/react-share-lite'}
image={'./react-share.png'}
/>
`
š Props: Supports only on VK
| Props | Type | Default | Description | Required |
| :-------- | :------ | :------ | :----------------------------------------------------------------------------------------------------------- | :------- |
| image | string | | An absolute link to the image that will be shared. | FALSE |
| noParse | boolean | | If true is passed, VK will not retrieve URL information. | FALSE |
| noVkLinks | boolean | | If true is passed, there will be no links to the user's profile in the open window. Only for mobile devices. | FALSE |
$3
šØāš» Example
`js
import { PinterestShare } from 'react-share-lite'
url={'https://github.com/ayda-tech/react-share-lite'}
media={'react-share-lite - social share buttons for next & react apps.'}
/>
`
š Props: Supports only on Pinterest
| Props | Type | Default | Description | Required |
| :---------- | :----- | :------ | :----------------------------------- | :------- |
| media | string | | The image URL that will be pinned. | TRUE |
| description | string | | The description of the shared media. | FALSE |
$3
šØāš» Example
`js
import { RedditShare } from 'react-share-lite'
`
$3
šØāš» Example
`js
import { LineShare } from 'react-share-lite'
`
$3
šØāš» Example
`js
import { TumblrShare } from 'react-share-lite'
url={'https://github.com/ayda-tech/react-share-lite'}
caption="react-share-lite - social share buttons for next & react apps."
/>
`
š Props: Supports only on Tumblr
| Props | Type | Default | Description | Required |
| :------- | :------------------------------- | :---------------- | :---------------------------------- | :------- |
| tags | Array<string> | | An array of tags to be shared. | FALSE |
| caption | string | | The description of the shared page. | FALSE |
| posttype | string | link | The type of the post. | FALSE |
$3
šØāš» Example
`js
import { ViberShare } from 'react-share-lite'
url={'https://github.com/ayda-tech/react-share-lite'}
title={'react-share-lite - social share buttons for next & react apps.'}
/>
`
š Props: Supports only on Viber
| Props | Type | Default | Description | Required |
| :-------- | :----- | :------ | :---------- | :------- |
| separator | string | | | FALSE |
$3
šØāš» Example
`js
import { WeiboShare } from 'react-share-lite'
url={'https://github.com/ayda-tech/react-share-lite'}
title={'react-share-lite - social share buttons for next & react apps.'}
image={${String(window.location)}/${example - image}}
/>
`
š Props: Supports only on Weibo
| Props | Type | Default | Description | Required |
| :---- | :----- | :------ | :--------------------------------- | :------- |
| image | string | | The image URL that will be shared. | FALSE |
$3
šØāš» Example
`js
import { MailruShare } from 'react-share-lite'
`
š Props: Supports only on Mail-Ru
| Props | Type | Default | Description | Required |
| :---------- | :----- | :------ | :------------------------------ | :------- |
| description | string | | Description of the shared page. | FALSE |
| imageUrl | string | | Image url of the shared page. | FALSE |
$3
šØāš» Example
`js
import { LiveJournalShare } from 'react-share-lite'
`
š Props: Supports only on Live Journal
| Props | Type | Default | Description | Required |
| :---------- | :----- | :------ | :------------------------------ | :------- |
| description | string | | Description of the shared page. | FALSE |
$3
šØāš» Example
`js
import { WorkplaceShare } from 'react-share-lite'
url={'https://github.com/ayda-tech/react-share-lite'}
quote={'React Share Lite'}
/>
`
š Props: Supports only on Workspace
| Props | Type | Default | Description | Required |
| :------ | :----- | :------ | :---------- | :------- |
| quote | string | | A quote to be shared. | FALSE |
| hashtag | string | | Hashtags to be shared. | FALSE |
$3
šØāš» Example
`js
import {
PocketShare
} from 'react-share-lite'
`
$3
šØāš» Example
`js
import { InstapaperShare } from 'react-share-lite'
`
š Props: Supports only on Instapaper
| Props | Type | Default | Description | Required |
| :---------- | :----- | :------ | :------------------------------ | :------- |
| description | string | | Description of the shared page. | FALSE |
$3
šØāš» Example
`js
import {
HatenaShare
} from 'react-share-lite'
`
$3
šØāš» Example
`js
import { GabShare } from 'react-share-lite'
``