You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project is looking for maintainers. If you want to support this projet you can create an issue explaining your motivation to support it.
Please only apply if your are serious about maintaining a library project on Github.
A library to easily display alerts and confirmations using React and Bootstrap. With react-bootstrap-confirmation
displaying an alert or a confirmation dialog is just as easy as calling a function:
import{alert}from'react-bootstrap-confirmation';alert('Something very wrong happened!');
An asynchronous function that will return once the alert has been dismissed.
Example
importReact,{useState}from'react';import{alert}from'react-bootstrap-confirmation';constAlertButton=()=>{constdisplay=async()=>{awaitalert('Something very wrong is happening!');console.log('The alert has finished displaying');};return(<buttontype="button"className="btn btn-primary"onClick={display}>
Display alert
</button>);};
Options
Parameter name
Type
Description
Default
title
string
A facultative title to use for the modal.
undefined
okText
string
The text of the "OK" button
"OK"
okButtonStyle
string
The style of the "OK" button. Must correspond to one of the 6 button styles of Bootstrap.
"primary"
confirm(message[, options])
An asynchronous function that will return true if the user clicks the "OK" button and false in the other cases.
Example
importReact,{useState}from'react';import{confirm}from'react-bootstrap-confirmation';constConfirmButton=()=>{constdisplay=async()=>{constresult=awaitalert('Are you really sure?');console.log('True if confirmed, false otherwise:',result);};return(<buttontype="button"className="btn btn-primary"onClick={display}>
Display alert
</button>);};
Options
Parameter name
Type
Description
Default
title
string
A facultative title to use for the modal.
undefined
okText
string
The text of the "OK" button
"OK"
okButtonStyle
string
The style of the "OK" button. Must correspond to one of the 6 button styles of Bootstrap.
"primary"
cancelText
string
The text of the "Cancel" button
"Cancel"
cancelButtonStyle
string
The style of the "Cancel" button. Must correspond to one of the 6 button styles of Bootstrap.
"secondary"
About
A library to easily display alerts and confirmations using React and Bootstrap