1.0.0 • Published 7 months ago
react-dialogues v1.0.0
react-dialogues
Simple but flexible modal dialog library inspired by Ant Design
WIP! The project is still in beta stage
import { CancelButton, Modal, OkButton } from 'react-dialogues';
export default function App() {
return (
<Button
onClick={async () => {
const result = await Modal.info({
title: 'Information',
content: 'Example',
buttons: [<Modal.OkButton />, <Modal.CancelButton />],
});
if (result === 'ok') {
console.log('Ok button clicked');
} else {
console.log('Cancel button clicked');
}
}}
>
Show Modal
</Button>
);
}