Alert

Alert messages are meant to provide contextual feedback about important changes in the interface.

Props

NameTypeDescriptionDefault
type'info' | 'confirm' | 'warning' | 'error'Uses one of the available alert types.'info'
mode'inline' | 'modal'Uses one of the available alert modes:
  • inline: Renders as a regular component, following the natural order of the elements in the document tree.
  • modal: The alert will be displayed in the middle of the screen with an overlay layer behind. In this mode, the user has the responsibility of hiding the alert with the onClose event, otherwise the overlaid modal will remain visible.
'inline'
inlineTextstringMessage of the alert.-
onClose() => voidIf defined, a close button will be displayed and this function will be executed when the action is clicked. When mode="modal" this function will also be executed when the background overlay is clicked. The user has the responsibility of hiding the modal, otherwise it will remain visible.-
childrenReact.ReactNodeThe details section of the alert. Can be used to render custom content in this area.-
margin'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | MarginSize of the margin to be applied to the component. You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.-
size'small' | 'medium' | 'large' | 'fillParent' | 'fitContent'Size of the component.'fitContent'
tabIndexnumberValue of the tabindex attribute applied to the close button.0

Examples

Basic usage

Modal