Skip to main content

Alert API

API documentation for the React Alert component. Learn about the available props.

Import


import { Alert } from 'repopup';

Props

PropTypeDescriptionDefault
closeOnBackdropClickbooleanWheather or not to close the popup on clicking the backdroptrue
confirmButtonTextstringUse this to change the text on the "Confirm"-button.'Confirm'
denyButtonTextstringUse this to change the text on the "Deny"-button.'Deny'
variantsuccess| error| info| warning| question| nullvarinat of a icon to be shownnull
onConfirmReact.MouseEventHandler<HTMLButtonElement> | undefinedUse this as a click handler for the "Confirm"-button() => {}
onDenyReact.MouseEventHandler<HTMLButtonElement> | undefinedUse this as a click handler for the "Deny"-button.() => {}
placement'top'| 'center' | 'bottom'| 'center-start'| 'bottom-start'| 'top-start'| 'top-end'| 'bottom-end'| 'center-end'Use this to change Popup window positioncenter
showConfirmButtonbooleanIf set to true, a "Confirm"-button will be shown.false
showDenyButtonbooleanIf set to true, a "Deny"-button will be shown.false
subtitlestringUsed for a description for the popup.
titlestringUsed for the title of the popup
openbooleanBoolean describing if the modal should be shown or not.required
onRequestCloseFunctionFunction that will be run when the modal is requested to be closedrequired

Demos