New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bs4-modal-react

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bs4-modal-react - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

7

package.json
{
"name": "bs4-modal-react",
"version": "0.0.2",
"version": "0.1.0",
"description": "bs4-modal-react React component",

@@ -21,3 +21,5 @@ "main": "lib/index.js",

"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
"build-storybook": "build-storybook",
"deploy": "np",
"postdeploy": "gh-pages -d ./storybook-static/"
},

@@ -37,2 +39,3 @@ "dependencies": {

"bootstrap": "^4.0.0-beta",
"gh-pages": "^1.0.0",
"jest": "^20.0.4",

@@ -39,0 +42,0 @@ "nwb": "0.18.x",

@@ -7,4 +7,60 @@ # bs4-modal-react

Describe bs4-modal-react here.
See the storybook demos [here](https://mauricedb.github.io/bs4-modal-react/)
## Install
```
npm install bs4-modal-react
npm install bootstrap@4.0.0-beta
```
## Usage
Make sure you include the [Boostrap 4](http://getbootstrap.com/) CSS as that is not included in this package.
```jsx
import React, { Component } from "react";
import "bootstrap/dist/css/bootstrap.css";
import { Modal, ModalHeader, ModalTitle, ModalBody, ModalFooter } from "bs4-modal-react";
class Demo extends Component {
state = {
visible: false
};
onShow = () => this.setState({ visible: true });
onHide = () => this.setState({ visible: false });
onSave = () => {
alert("Saving changes");
this.onHide();
};
render() {
const { visible } = this.state;
return (
<div>
<button type="button" className="btn btn-primary" onClick={this.onShow}>
Launch modal
</button>
<Modal visible={visible} onHide={this.onHide}>
<ModalHeader>
<ModalTitle>Modal title</ModalTitle>
</ModalHeader>
<ModalBody>Woohoo, you're reading this text in a modal!</ModalBody>
<ModalFooter>
<button type="button" className="btn btn-secondary" onClick={this.onHide}>
Close
</button>
<button type="button" className="btn btn-primary" onClick={this.onSave}>
Save changes
</button>
</ModalFooter>
</Modal>
</div>
);
}
}
```
[build-badge]: https://img.shields.io/travis/mauricedb/bs4-modal-react/master.png?style=flat-square

@@ -11,0 +67,0 @@ [build]: https://travis-ci.org/mauricedb/bs4-modal-react

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc