Mui-Prompt
Awesome and simple prompt components
with mui-prompt you can easily ask user for confirmation before executing an important action
Demo
Dialog
Inline
Demo
Install it
Mui-Prompt uses standard theme provider and will take your theme aswell!
nikandlv@nikandlv.ir:~$ npm i mui-prompt
Import it
import Prompt from "mui-prompt";
Dialog variant
render the prompt view
Component { { Prompt; } return <div> <Prompt.View /> <button =>click me!</button> </div> ; }
API
Prompt.ask first parameter is the key
of dialog and second parameter is the configuration which can be these values
const config = callback: callback title: "Are you sure?" body: "This action can not be undone!" cancel: "Cancel" continue: "Continue" nested: false;
Note:
nested
should be only applied on the parents and not the last nested item
Inline variant
In order to use inline variant simply wrap your Button
, IconButton
or any other component you want with Prompt.Inline
component
Component { return <div> <Prompt.Inline ="button"> <button =>click me!</button> </Prompt.Inline> <Prompt.Inline ="icon"> <button =>click me!</button> </Prompt.Inline> </div> ; }
Component props
<Prompt.Inline = ="Cancel" ="Continue" = = =/>