@gemcook/modal
v3.5.3
Published
---
Downloads
8
Readme
@gemcook/modal
React Modal Component.
Online Demo
- https://modal.storybook.gemcook.com
Installation
npm install --save @gemcook/modal
or
yarn add @gemcook/modal
Usage
SCSS
Import @gemcook/modal/lib/styles/index.scss
to your SCSS.
@import "~@gemcook/modal/lib/styles/index";
Examples
default
<div>
<Button
color="pink"
onClick={() => store.set({ isModal: !store.state.isModal })}
>
Open Modal
</Button>
<Modal
isModal={store.state.isModal}
ModalBody={Welcome}
handleCloseModal={() => store.set({ isModal: !store.state.isModal })}
/>
</div>
Documentaion
Props
| Parameter | Type | Required | Default | Description |
| :--------------- | :------------------------- | :----------- | :---------- | :-------------------------------------------- |
| isModal | boolean | true | undefined | - |
| ModalBody | React.Element | true | undefined | - |
| handleCloseModal | (isModal: boolean) => void | true | undefined | - |
| size | enum | false | 'sm' | Enums: 'xs', 'sm', 'md', 'lg', 'xl', 'full'
|
License
@gemcook/modal is released under the MIT license.