An open API service indexing awesome lists of open source software.

https://github.com/suhdev/sh-react-modal

A modal component for ReactJS application written in TypeScript.
https://github.com/suhdev/sh-react-modal

Last synced: about 1 year ago
JSON representation

A modal component for ReactJS application written in TypeScript.

Awesome Lists containing this project

README

          

# sh-react-modal

A configurable modal component for ReactJS application written in TypeScript.

```javascript
var el = document.createElement('div');
el.className = 'container';
document.body.appendChild(el);
var service = ShReact.createModalService(el);
service.show({
content:(onSuccess,onHide)=>{
return (
React.createElement('div',{className:'test',onClick:onSuccess,title:'Test Dialog'},'Test')
);
},
props:{
title:"Test Dialog",
hasClose:true,
closeOnBackdrop:false
}})
.then(function(em){
return service.show({
content:(onSuccess,onCancel)=>{
return (null);
},
props:{
buttons:[{
label:'OK',
key:'ok'
},{
label:'Cancel',
key:'cancel'
}]
}});
},function(ez){
console.log(ez);
})
.then(function(et){
console.log(et);
});

```