react-share-modal
TypeScript icon, indicating that this package has built-in type declarations

0.1.6 • Public • Published

react-share-modal

You can share the current url on various social media by opening the Share modal

Install

npm install react-share-modal
# or
yarn add react-share-modal

Usage

Information about the example code, prop type, and style for the package modal.

basic

Title Image

children & lang = 'ko'

Title Image

Example

import { ShareModal } from "react-share-modal";

export default function App() {
  const [isOpen, setIsOpen] = useState < boolean > false;

  return (
    <>
      <button type="button" onClick={() => setIsOpen(true)}>
        open
      </button>

      <ShareModal
        view={isOpen}
        onCancel={() => setIsOpen(false)}
        theme="light"
        lang="ko"
      >
        // children
        <button type="type">
          <KakaoIcon />
          <span>Kakao</span>
        </button>
      </ShareModal>
    </>
  );
}

Default Kind

  • Facebook
  • Twitter

  • Telegram

  • Line

  • What's App

  • Clipboard


Props

props type description
view bool Use isOpen state to open the modal
onCancel () => void Use this function to close the modal
theme string default: 'light' / 'dark'
lang string default: 'en' / 'ko'
children React.ReactNode You can add a sharing function through chlidren

Size

name size
icon 50px // max-width: 48px
span 12px

Package Sidebar

Install

npm i react-share-modal

Weekly Downloads

2

Version

0.1.6

License

ISC

Unpacked Size

30 kB

Total Files

10

Last publish

Collaborators

  • deepdesign