Alert

Alerts are temporary notifications that provide concise feedback about an action or event.


Installation

npx nextui-cli@latest add alert
The above command is for individual installation only. You may skip this step if @nextui-org/react is already installed globally.

Import

Usage

Radius

Colors

IsCloseable

If isCloseable is true, a close button appear on alert which can be used to close it. It is set to true by default.

API

Alert Props

AttributeTypeDescriptionDefault
titlestringTitle for alert-
descriptionReactNodeDescription for alert message-
colordefault | primary | secondary | success | warning | dangerThe alert color theme.default
radiusnone | sm | md | lg | fullThe alert border radius.md
isCloseablebooleanWhether the close button should be displayed.true

Alert Events

AttributeTypeDescription
onClose() => voidHandler that is called when the close button is clicked.