react-share

  • Version 6.1.0
  • Published
  • 579 kB
  • 1 dependency
  • MIT license

Install

npm i react-share
yarn add react-share
pnpm add react-share

Overview

Social media share buttons for React.

Index

Variables

Functions

Type Aliases

Variables

variable BlueskyShareButton

const BlueskyShareButton: ForwardRefExoticComponent<any>;

    variable buildBlueskyShareUrl

    const buildBlueskyShareUrl: (
    url: string,
    { text, separator }: { text?: string; separator?: string }
    ) => string;

      variable buildEmailShareUrl

      const buildEmailShareUrl: (
      url: string,
      { subject, body, separator, to }: Options
      ) => string;

        variable buildFacebookMessengerShareUrl

        const buildFacebookMessengerShareUrl: (
        url: string,
        { appId, redirectUri, to }: Options_2
        ) => string;

          variable buildFacebookShareUrl

          const buildFacebookShareUrl: (
          url: string,
          { hashtag }: { hashtag?: string }
          ) => string;

            variable buildFarcasterShareUrl

            const buildFarcasterShareUrl: (
            url: string,
            { channelKey, parentCastHash, text }: FarcasterOptions
            ) => string;

              variable buildGabShareUrl

              const buildGabShareUrl: (url: string, { text }: { text?: string }) => string;

                variable buildHatenaShareUrl

                const buildHatenaShareUrl: (
                url: string,
                { shareTitle }: { shareTitle?: string }
                ) => string;

                  variable buildInstapaperShareUrl

                  const buildInstapaperShareUrl: (
                  url: string,
                  { shareTitle, description }: { shareTitle?: string; description?: string }
                  ) => string;

                    variable buildLineShareUrl

                    const buildLineShareUrl: (url: string, { text }: { text?: string }) => string;

                      variable buildLinkedinShareUrl

                      const buildLinkedinShareUrl: (url: string) => string;

                        variable buildLivejournalShareUrl

                        const buildLivejournalShareUrl: (
                        url: string,
                        { shareTitle, description }: { shareTitle?: string; description?: string }
                        ) => string;

                          variable buildMailruShareUrl

                          const buildMailruShareUrl: (
                          url: string,
                          {
                          shareTitle,
                          description,
                          imageUrl,
                          }: { shareTitle?: string; description?: string; imageUrl?: string }
                          ) => string;

                            variable buildOKShareUrl

                            const buildOKShareUrl: (
                            url: string,
                            {
                            shareTitle,
                            description,
                            image,
                            }: { shareTitle?: string; description?: string; image?: string }
                            ) => string;

                              variable buildPinterestShareUrl

                              const buildPinterestShareUrl: (
                              url: string,
                              { media, description, pinId }: PinterestShareProps
                              ) => string;

                                variable buildRedditShareUrl

                                const buildRedditShareUrl: (
                                url: string,
                                { shareTitle }: { shareTitle?: string }
                                ) => string;

                                  variable buildTelegramShareUrl

                                  const buildTelegramShareUrl: (url: string, { text }: { text?: string }) => string;

                                    variable buildThreadsShareUrl

                                    const buildThreadsShareUrl: (url: string, { text }: { text?: string }) => string;

                                      variable buildTumblrShareUrl

                                      const buildTumblrShareUrl: (
                                      url: string,
                                      {
                                      postTitle,
                                      caption,
                                      tags,
                                      posttype,
                                      content,
                                      }: {
                                      postTitle?: string;
                                      caption?: string;
                                      tags?: string;
                                      posttype?: TumblrPostType;
                                      content?: string;
                                      }
                                      ) => string;

                                        variable buildViberShareUrl

                                        const buildViberShareUrl: (
                                        url: string,
                                        { message, separator }: { message?: string; separator?: string }
                                        ) => string;

                                          variable buildVKShareUrl

                                          const buildVKShareUrl: (
                                          url: string,
                                          { shareTitle, image, noParse, noVkLinks }: Options_5
                                          ) => string;

                                            variable buildWeiboShareUrl

                                            const buildWeiboShareUrl: (
                                            url: string,
                                            { shareTitle, image }: { shareTitle?: string; image?: string }
                                            ) => string;

                                              variable buildWhatsappShareUrl

                                              const buildWhatsappShareUrl: (
                                              url: string,
                                              { message, phone, separator }: WhatsappOptions
                                              ) => string;

                                                variable buildXShareUrl

                                                const buildXShareUrl: (
                                                url: string,
                                                {
                                                text,
                                                via,
                                                hashtags,
                                                related,
                                                }: { text?: string; via?: string; hashtags?: string[]; related?: string[] }
                                                ) => string;

                                                  variable EmailShareButton

                                                  const EmailShareButton: ForwardRefExoticComponent<any>;

                                                    variable FacebookMessengerShareButton

                                                    const FacebookMessengerShareButton: ForwardRefExoticComponent<any>;

                                                      variable FacebookShareButton

                                                      const FacebookShareButton: ForwardRefExoticComponent<any>;

                                                        variable FarcasterShareButton

                                                        const FarcasterShareButton: ForwardRefExoticComponent<any>;

                                                          variable GabShareButton

                                                          const GabShareButton: ForwardRefExoticComponent<any>;

                                                            variable HatenaShareButton

                                                            const HatenaShareButton: ForwardRefExoticComponent<any>;

                                                              variable InstapaperShareButton

                                                              const InstapaperShareButton: ForwardRefExoticComponent<any>;

                                                                variable LineShareButton

                                                                const LineShareButton: ForwardRefExoticComponent<any>;

                                                                  variable LinkedinShareButton

                                                                  const LinkedinShareButton: ForwardRefExoticComponent<any>;

                                                                    variable LivejournalShareButton

                                                                    const LivejournalShareButton: ForwardRefExoticComponent<any>;

                                                                      variable MailruShareButton

                                                                      const MailruShareButton: ForwardRefExoticComponent<any>;

                                                                        variable NativeShareButton

                                                                        const NativeShareButton: default_2.ForwardRefExoticComponent<any>;

                                                                          variable OKShareButton

                                                                          const OKShareButton: ForwardRefExoticComponent<any>;

                                                                            variable PinterestShareButton

                                                                            const PinterestShareButton: ForwardRefExoticComponent<any>;

                                                                              variable RedditShareButton

                                                                              const RedditShareButton: ForwardRefExoticComponent<any>;

                                                                                variable TelegramShareButton

                                                                                const TelegramShareButton: ForwardRefExoticComponent<any>;

                                                                                  variable ThreadsShareButton

                                                                                  const ThreadsShareButton: ForwardRefExoticComponent<any>;

                                                                                    variable TumblrShareButton

                                                                                    const TumblrShareButton: ForwardRefExoticComponent<any>;

                                                                                      variable ViberShareButton

                                                                                      const ViberShareButton: ForwardRefExoticComponent<any>;

                                                                                        variable VKShareButton

                                                                                        const VKShareButton: ForwardRefExoticComponent<any>;

                                                                                          variable WeiboShareButton

                                                                                          const WeiboShareButton: ForwardRefExoticComponent<any>;

                                                                                            variable WhatsappShareButton

                                                                                            const WhatsappShareButton: ForwardRefExoticComponent<any>;

                                                                                              variable XShareButton

                                                                                              const XShareButton: ForwardRefExoticComponent<any>;

                                                                                                Functions

                                                                                                function BlueskyIcon

                                                                                                BlueskyIcon: (props: RawIconProps) => JSX.Element;

                                                                                                  function BlueskyLegacyIcon

                                                                                                  BlueskyLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                    blueskyLink: (
                                                                                                    url: string,
                                                                                                    { text, separator }: { text?: string; separator?: string }
                                                                                                    ) => string;

                                                                                                      function canNativeShare

                                                                                                      canNativeShare: (data?: NativeShareData) => boolean;

                                                                                                        function EmailIcon

                                                                                                        EmailIcon: (props: RawIconProps) => JSX.Element;

                                                                                                          function EmailLegacyIcon

                                                                                                          EmailLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                            emailLink: (url: string, { subject, body, separator, to }: Options) => string;

                                                                                                              function FacebookIcon

                                                                                                              FacebookIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                function FacebookLegacyIcon

                                                                                                                FacebookLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                  facebookLink: (url: string, { hashtag }: { hashtag?: string }) => string;

                                                                                                                    function FacebookMessengerIcon

                                                                                                                    FacebookMessengerIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                      function FacebookMessengerLegacyIcon

                                                                                                                      FacebookMessengerLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                        facebookMessengerLink: (
                                                                                                                        url: string,
                                                                                                                        { appId, redirectUri, to }: Options_2
                                                                                                                        ) => string;

                                                                                                                          function FarcasterIcon

                                                                                                                          FarcasterIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                            function FarcasterLegacyIcon

                                                                                                                            FarcasterLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                              farcasterLink: (
                                                                                                                              url: string,
                                                                                                                              { channelKey, parentCastHash, text }: FarcasterOptions
                                                                                                                              ) => string;

                                                                                                                                function GabIcon

                                                                                                                                GabIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                  function GabLegacyIcon

                                                                                                                                  GabLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                                    gabLink: (url: string, { text }: { text?: string }) => string;

                                                                                                                                      function HatenaIcon

                                                                                                                                      HatenaIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                        function HatenaLegacyIcon

                                                                                                                                        HatenaLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                                          hatenaLink: (url: string, { shareTitle }: { shareTitle?: string }) => string;

                                                                                                                                            function InstapaperIcon

                                                                                                                                            InstapaperIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                              function InstapaperLegacyIcon

                                                                                                                                              InstapaperLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                                                instapaperLink: (
                                                                                                                                                url: string,
                                                                                                                                                { shareTitle, description }: { shareTitle?: string; description?: string }
                                                                                                                                                ) => string;

                                                                                                                                                  function LineIcon

                                                                                                                                                  LineIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                                    function LineLegacyIcon

                                                                                                                                                    LineLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                                                      lineLink: (url: string, { text }: { text?: string }) => string;

                                                                                                                                                        function LinkedinIcon

                                                                                                                                                        LinkedinIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                                          function LinkedinLegacyIcon

                                                                                                                                                          LinkedinLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                                                            linkedinLink: (url: string) => string;

                                                                                                                                                              function LivejournalIcon

                                                                                                                                                              LivejournalIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                                                function LivejournalLegacyIcon

                                                                                                                                                                LivejournalLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                                                                  livejournalLink: (
                                                                                                                                                                  url: string,
                                                                                                                                                                  { shareTitle, description }: { shareTitle?: string; description?: string }
                                                                                                                                                                  ) => string;

                                                                                                                                                                    function MailruIcon

                                                                                                                                                                    MailruIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                                                      function MailruLegacyIcon

                                                                                                                                                                      MailruLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                                                                        mailruLink: (
                                                                                                                                                                        url: string,
                                                                                                                                                                        {
                                                                                                                                                                        shareTitle,
                                                                                                                                                                        description,
                                                                                                                                                                        imageUrl,
                                                                                                                                                                        }: { shareTitle?: string; description?: string; imageUrl?: string }
                                                                                                                                                                        ) => string;

                                                                                                                                                                          function NativeShareIcon

                                                                                                                                                                          NativeShareIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                                                            function NativeShareLegacyIcon

                                                                                                                                                                            NativeShareLegacyIcon: (props: LegacyIconProps) => JSX.Element;

                                                                                                                                                                              function OKIcon

                                                                                                                                                                              OKIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                                                                function OKLegacyIcon

                                                                                                                                                                                OKLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                                                                                  okLink: (
                                                                                                                                                                                  url: string,
                                                                                                                                                                                  {
                                                                                                                                                                                  shareTitle,
                                                                                                                                                                                  description,
                                                                                                                                                                                  image,
                                                                                                                                                                                  }: { shareTitle?: string; description?: string; image?: string }
                                                                                                                                                                                  ) => string;

                                                                                                                                                                                    function openShareWindow

                                                                                                                                                                                    openShareWindow: (
                                                                                                                                                                                    url: string,
                                                                                                                                                                                    { height, newTab, onClose, position, width }?: ShareWindowOptions
                                                                                                                                                                                    ) => Window | null;

                                                                                                                                                                                      function PinterestIcon

                                                                                                                                                                                      PinterestIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                                                                        function PinterestLegacyIcon

                                                                                                                                                                                        PinterestLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                                                                                          pinterestLink: (
                                                                                                                                                                                          url: string,
                                                                                                                                                                                          { media, description, pinId }: PinterestShareProps
                                                                                                                                                                                          ) => string;

                                                                                                                                                                                            function RedditIcon

                                                                                                                                                                                            RedditIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                                                                              function RedditLegacyIcon

                                                                                                                                                                                              RedditLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                                                                                                redditLink: (url: string, { shareTitle }: { shareTitle?: string }) => string;

                                                                                                                                                                                                  function shareNative

                                                                                                                                                                                                  shareNative: (data: NativeShareData) => Promise<void>;

                                                                                                                                                                                                    function TelegramIcon

                                                                                                                                                                                                    TelegramIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                                                                                      function TelegramLegacyIcon

                                                                                                                                                                                                      TelegramLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                                                                                                        telegramLink: (url: string, { text }: { text?: string }) => string;

                                                                                                                                                                                                          function ThreadsIcon

                                                                                                                                                                                                          ThreadsIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                                                                                            function ThreadsLegacyIcon

                                                                                                                                                                                                            ThreadsLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                                                                                                              threadsLink: (url: string, { text }: { text?: string }) => string;

                                                                                                                                                                                                                function TumblrIcon

                                                                                                                                                                                                                TumblrIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                                                                                                  function TumblrLegacyIcon

                                                                                                                                                                                                                  TumblrLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                                                                                                                    tumblrLink: (
                                                                                                                                                                                                                    url: string,
                                                                                                                                                                                                                    {
                                                                                                                                                                                                                    postTitle,
                                                                                                                                                                                                                    caption,
                                                                                                                                                                                                                    tags,
                                                                                                                                                                                                                    posttype,
                                                                                                                                                                                                                    content,
                                                                                                                                                                                                                    }: {
                                                                                                                                                                                                                    postTitle?: string;
                                                                                                                                                                                                                    caption?: string;
                                                                                                                                                                                                                    tags?: string;
                                                                                                                                                                                                                    posttype?: TumblrPostType;
                                                                                                                                                                                                                    content?: string;
                                                                                                                                                                                                                    }
                                                                                                                                                                                                                    ) => string;

                                                                                                                                                                                                                      function ViberIcon

                                                                                                                                                                                                                      ViberIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                                                                                                        function ViberLegacyIcon

                                                                                                                                                                                                                        ViberLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                                                                                                                          viberLink: (
                                                                                                                                                                                                                          url: string,
                                                                                                                                                                                                                          { message, separator }: { message?: string; separator?: string }
                                                                                                                                                                                                                          ) => string;

                                                                                                                                                                                                                            function VKIcon

                                                                                                                                                                                                                            VKIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                                                                                                              function VKLegacyIcon

                                                                                                                                                                                                                              VKLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                                                                                                                                vkLink: (
                                                                                                                                                                                                                                url: string,
                                                                                                                                                                                                                                { shareTitle, image, noParse, noVkLinks }: Options_5
                                                                                                                                                                                                                                ) => string;

                                                                                                                                                                                                                                  function WeiboIcon

                                                                                                                                                                                                                                  WeiboIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                                                                                                                    function WeiboLegacyIcon

                                                                                                                                                                                                                                    WeiboLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                                                                                                                                      weiboLink: (
                                                                                                                                                                                                                                      url: string,
                                                                                                                                                                                                                                      { shareTitle, image }: { shareTitle?: string; image?: string }
                                                                                                                                                                                                                                      ) => string;

                                                                                                                                                                                                                                        function WhatsappIcon

                                                                                                                                                                                                                                        WhatsappIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                                                                                                                          function WhatsappLegacyIcon

                                                                                                                                                                                                                                          WhatsappLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                                                                                                                                            whatsappLink: (
                                                                                                                                                                                                                                            url: string,
                                                                                                                                                                                                                                            { message, phone, separator }: WhatsappOptions
                                                                                                                                                                                                                                            ) => string;

                                                                                                                                                                                                                                              function XIcon

                                                                                                                                                                                                                                              XIcon: (props: RawIconProps) => JSX.Element;

                                                                                                                                                                                                                                                function XLegacyIcon

                                                                                                                                                                                                                                                XLegacyIcon: (props: LegacyIconProps) => JSX.Element;
                                                                                                                                                                                                                                                  xLink: (
                                                                                                                                                                                                                                                  url: string | undefined,
                                                                                                                                                                                                                                                  {
                                                                                                                                                                                                                                                  text,
                                                                                                                                                                                                                                                  via,
                                                                                                                                                                                                                                                  hashtags,
                                                                                                                                                                                                                                                  related,
                                                                                                                                                                                                                                                  }: { text?: string; via?: string; hashtags?: string[]; related?: string[] }
                                                                                                                                                                                                                                                  ) => string;

                                                                                                                                                                                                                                                    Type Aliases

                                                                                                                                                                                                                                                    type NativeShareData

                                                                                                                                                                                                                                                    type NativeShareData = Pick<ShareData, 'files' | 'text' | 'title' | 'url'>;

                                                                                                                                                                                                                                                      type ShareWindowOptions

                                                                                                                                                                                                                                                      type ShareWindowOptions = {
                                                                                                                                                                                                                                                      height?: number;
                                                                                                                                                                                                                                                      /** Open a regular browser tab instead of a sized popup window. */
                                                                                                                                                                                                                                                      newTab?: boolean;
                                                                                                                                                                                                                                                      onClose?: (dialog: Window | null) => void;
                                                                                                                                                                                                                                                      position?: WindowPosition;
                                                                                                                                                                                                                                                      width?: number;
                                                                                                                                                                                                                                                      };

                                                                                                                                                                                                                                                        type WindowPosition

                                                                                                                                                                                                                                                        type WindowPosition = 'windowCenter' | 'screenCenter';

                                                                                                                                                                                                                                                          Package Files (1)

                                                                                                                                                                                                                                                          Dependencies (1)

                                                                                                                                                                                                                                                          Dev Dependencies (29)

                                                                                                                                                                                                                                                          Peer Dependencies (1)

                                                                                                                                                                                                                                                          Badge

                                                                                                                                                                                                                                                          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                                          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/react-share.

                                                                                                                                                                                                                                                          • Markdown
                                                                                                                                                                                                                                                            [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/react-share)
                                                                                                                                                                                                                                                          • HTML
                                                                                                                                                                                                                                                            <a href="https://www.jsdocs.io/package/react-share"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>