Skip to content
  • Android
  • iOS
  • Web

Alert

An Alert component is a UI element used to display important messages or notifications to users. It can convey different types of information such as success, warning, error, or informational messages, typically styled with distinct colors and icons to highlight the message's significance. Alerts are often used to grab the user's attention and provide immediate feedback on actions or events.

Live examples

Example.tsx

Attributes

NAlert attributes
NameTypeDefaultDetails
typestringdefaultSets the indicator and title color. Use default, info, success, warning, or error.
messageReactNodeOptionalDetail text below the title.
titleReactNodeOptionalA short heading for the alert.
iconReactNodeOptionalOverrides the status icon. Pass null to hide it.
actionsReactNodeOptionalAdditional controls beside the message.
classNamestringOptionalSupported Tailwind-style utilities, resolved entirely in Rust. See the engine README.
titleClassNamestringOptionalClasses applied to the title.
messageClassNamestringOptionalClasses applied to the message.
closeClassNamestringOptionalClasses applied to the close button.
onClose(() => void)OptionalAdds a close button and runs when it is pressed.
rolestringOptional
childrenReactNodeOptional
descriptionstringOptional
Engine reference for AlertSet up engine components

Tags