Boron
A collection of dialog animations with React.js.
- React 0.14+ Use
boron 0.2
- React 0.12+ Use
boron 0.1
Demo & Examples
Live demo: yuanyan.github.io/boron
To build the examples locally, run:
npm install
gulp dev
Then open localhost:9999
in a browser.
Installation
The easiest way to use boron
is to install it from NPM and include it in your own React build process (using Browserify, etc).
You can also use the standalone build by including dist/boron.js
in your page. If you use this, make sure you have already included React, and it is available as a global variable.
npm install boron --save
Usage
var Modal = ;var Example = React;
Props
- className - Add custom class name.
- keyboard - Close the modal when escape key is pressed.
- backdrop - Includes a backdrop element.
- closeOnClick - Close the backdrop element when clicked.
- onShow - Show callback.
- onHide - Hide callback.
- modalStyle - CSS styles to apply to the modal
- backdropStyle - CSS styles to apply to the backdrop
- contentStyle - CSS styles to apply to the modal's content
Custom Styles
Objects consisting of CSS properties/values can be passed as props to the Modal component. The values for the CSS properties will either add new properties or override the default property value set for that Modal type.
Modal with 80% width:
var Modal = ;// Style objectvar modalStyle =width: '80%';var Example = React;
Red backdrop with a blue modal, rotated at 45 degrees:
var Modal = ;// Individual styles for the modal, modal content, and backdropvar modalStyle =transform: 'rotate(45deg) translateX(-50%)';var backdropStyle =backgroundColor: 'red';var contentStyle =backgroundColor: 'blue'height: '100%';var Example = React;
Modals
- DropModal
- FadeModal
- FlyModal
- OutlineModal
- ScaleModal
- WaveModal
Browser Support
![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|
IE 10+ ✔ | Chrome 4.0+ ✔ | Firefox 16.0+ ✔ | Opera 15.0+ ✔ | Safari 4.0+ ✔ |