Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
react16-modal-bootstrap
Advanced tools
Modal component for ReactJS with Bootstrap style. React16 support.
Modal component for React with bootstrap style.
Fork of @zbuttram branch react-16-radium-fix published to NPM.
npm install --save react16-modal-bootstrap
bower install --save react16-modal-bootstrap
Webpack:
require('path/to/bootstrap.css');
Without Webpack:
<link rel="stylesheet" type="text/css" href="path/to/bootstrap.css">
import {
Modal,
ModalHeader,
ModalTitle,
ModalClose,
ModalBody,
ModalFooter
} from 'react-modal-bootstrap';
...
state = {
isOpen: false
};
openModal = () => {
this.setState({
isOpen: true
});
};
hideModal = () => {
this.setState({
isOpen: false
});
};
...
<Modal isOpen={this.state.isOpen} onRequestHide={this.hideModal}>
<ModalHeader>
<ModalClose onClick={this.hideModal}/>
<ModalTitle>Modal title</ModalTitle>
</ModalHeader>
<ModalBody>
<p>Ab ea ipsam iure perferendis! Ad debitis dolore excepturi
explicabo hic incidunt placeat quasi repellendus soluta,
vero. Autem delectus est laborum minus modi molestias
natus provident, quidem rerum sint, voluptas!</p>
</ModalBody>
<ModalFooter>
<button className='btn btn-default' onClick={this.hideModal}>
Close
</button>
<button className='btn btn-primary'>
Save changes
</button>
</ModalFooter>
</Modal>
Default:
backdropStyles = {
base: {
background: 'rgba(0, 0, 0, .7)',
opacity: 0,
visibility: 'hidden',
transition: 'all 0.4s',
overflowX: 'hidden',
overflowY: 'auto'
},
open: {
opacity: 1,
visibility: 'visible'
}
};
dialogStyles = {
base: {
top: -600,
transition: 'top 0.4s'
},
open: {
top: 0
}
}
Custom:
You can set custom styles vie backDropStyles
, dialogStyles
prop.
<link rel="stylesheet" type="text/css" href="path/to/bootstrap.css">
<script src="path/to/react16-modal-bootstrap/dist/react16-modal-bootstrap.js"></script>
...
var Modal = window.ReactModalBootstrap.Modal;
var ModalHeader = window.ReactModalBootstrap.ModalHeader;
var ModalTitle = window.ReactModalBootstrap.ModalTitle;
var ModalClose = window.ReactModalBootstrap.ModalClose;
var ModalBody = window.ReactModalBootstrap.ModalBody;
var ModalFooter = window.ReactModalBootstrap.ModalFooter;
...
Example here
Name | Type | Default | Description |
---|---|---|---|
isOpen | bool | false | |
backdrop | bool | true | Close when click on backdrop |
keyboard | bool | true | Close when press ESC |
size | string | '' | 'modal-lg' or 'modal-sm' |
onRequestHide | function | function(){} | Callback when modal request hide |
backdropStyles | object | {} | Styles object (Radium) |
dialogStyles | object | {} | Styles object (Radium) |
View demo or example folder.
FAQs
Modal component for ReactJS with Bootstrap style. React16 support.
We found that react16-modal-bootstrap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.