react-share-modal
v0.1.6
Published
react-share-modal
Downloads
18
Maintainers
Readme
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
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 |