iw-modal
v1.2.17
Published
modern modal library
Downloads
48
Readme
iw-modal
setup
パッケージインストール
npm i
npm i iw-modal
ソースコード
import { IWModal } from 'iw-modal'
const iwModal = new IWModal.Core('.className')
Reactの場合
import { IWModal, IWModalBtn } from "iw-modal/script/react";
import "iw-modal/style/index.css";
const Home = () => {
const [show, setShow] = useState<boolean>(false);
return (
<>
<IWModalBtn onIWModal={setShow}>ボタン</IWModalBtn>
<IWModal
IWModal={show}
onIWModal={setShow}
>
<p>モーダル</p>
</IWModal>
</>
);
};
CDNを使用する場合
CSS
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/src/style/index.css"/>
Javascript
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/src/script/index.min.js"></script>