Function
Static Public Summary | ||
public |
Modal({: object): ReactDom Simple Bulma Modal window |
Static Public
public Modal({: object): ReactDom source
import Modal from 'prg-editor/src/components/Modal.jsx'
Simple Bulma Modal window
PropTypes
prop | type | purpose | |
---|---|---|---|
onClosed |
function - required |
Called, when user presses close | |
title |
`string | react` - required | Is shown as title |
footer |
`string | react` | Is used as footer when customBody === false |
customBody |
boolean |
Enable to use own body and footer components (usefull for forms) |
Params:
Name | Type | Attribute | Description |
{ | object | onClosed, children, title, footer, customBody } |
Return:
ReactDom |
Example:
import { Modal } from 'prg-editor';
// basic usage
<Modal
title="Alert"
onClosed={() => console.log('please close me')}
>
<p className="title">Something Interesting!</p>
</Modal>
// providing own body
<Modal
title="Alert"
onClosed={() => console.log('please close me')}
customBody
>
<form>
<section className="modal-card-body">
<input name="input" />
</section>
<footer className="modal-card-foot">
<button>Submit</button>
</footer>
</form>
</Modal>