0.1.6 • Published 11 months ago

react-share-modal v0.1.6

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

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

children & lang = 'ko'

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

propstypedescription
viewboolUse isOpen state to open the modal
onCancel() => voidUse this function to close the modal
themestringdefault: 'light' / 'dark'
langstringdefault: 'en' / 'ko'
childrenReact.ReactNodeYou can add a sharing function through chlidren

Size

namesize
icon50px // max-width: 48px
span12px