React Redux Bootstrap Modal
This project is a bootstrap wrapper for redux-modal that allows you to create a stateful modal using redux
Getting Started
To use react-redux-bootstrap-modal
first add it to your project
npm install --save react-redux-bootstrap-modalnpm install --save bootstrap # bootstrap is a required peerDependency
After it's added to your project you can use it inside of your component
import * as React from 'react';import ModalWrapper show from 'react-redux-bootstrap-modal';import connect from 'redux';import MyModalBody from './somecomponent'; const MyComponent = showDialog <div> <button =>Show Dialog</button> <ModalWrapper ="my-modal" = /> </div>; const ConnectedComponent = MyComponent;
To hide the dialog, either click off the screen, or add the code
import hide from 'react-redux-bootstrap-modal';...;
inside your component which will comprise your modal body
Additional API Information
react-redux-bootstrap-modal
wraps the API from
redux-modal
You can find details to the other API function calls there.
This project adds the ModalWrapper
component which provides
a modal using react-bootstrap
as the modal component.
ModalWrapper
takes 2 mandatory properties:
name
- The name of the modalcomponent
- A React component which will be placed inside the modal body
Optional properties which are used to wrap library APIS
connectOptions
- Options which come from theconnectModal
in the redux-modal librarymodalOptions
- These map to properties for thereact-bootstrap
Modal componentclose
- boolean - whether to show the close button on the modal or notbackdrop
- Should modals have a backdrop?bsSize
- The size of the modal (small or large)
License
This project uses the MIT License
Project Tasks
Task Name | Description |
---|---|
build | builds the project sources (using babel) |
lint | Lints the project sources (eslint) |
test | Executes unit tests using jest |
clean | Cleans the lib director |