0.0.6 • Published 4 months ago
jattac.libs.web.modal v0.0.6
ModalDialog Component
A complete and simple to use React component for creating modal dialogs.
Installation
npm i jattac.libs.web.modal
Example
import React, { Component, ReactNode } from 'react';
import ModalDialog from 'jattac.libs.web.modal';
interface YourComponentProps {
isOpen: boolean
}
class YourComponent extends Component<YourComponentProps> {
render(): ReactNode {
return (
<ModalDialog isOpen={this.props.isOpen} onClose={() => console.log('Modal closed')}>
<div>
{/* Your modal content goes here */}
</div>
</ModalDialog>
);
}
}
Props
- isOpen (boolean, required): Controls whether the modal is open or closed.
- children (ReactNode, required): The content to be displayed inside the modal.
- onClose (function, required): Callback function to be executed when the modal is closed.