Flutter docs
Default skin

Alert

Display warning messages that require attention.

When to use

  • When you need to show alert messages to users.
  • When you need a persistent static container which is closable by user actions.

Examples

API

Alert and Alert.ErrorBoundary are exported from @ceebee/ui/client.

Alert

PropertyDescriptionTypeDefaultVersion
actionThe action of AlertReactNode-—
afterCloseCalled when close animation is finished, please use closable.afterClose instead() => void-—
bannerWhether to show as bannerbooleanfalse—
variantVariant of Alert styleoutlined | filledoutlined6.4.0
classNamesCustomize class for each semantic structure inside the component. Supports object or functionRecord<SemanticDOM, string> | (info: { props }) => Record<SemanticDOM, string>-—
closableThe config of closableboolean | ClosableType & React.AriaAttributesfalse—
closeIcon(Only supports global configuration) Custom close iconReactNode-×
descriptionAdditional content of AlertReactNode-—
errorIcon(Only supports global configuration) Custom error icon in Alert iconReactNode-×
iconCustom icon, effective when showIcon is trueReactNode-—
infoIcon(Only supports global configuration) Custom info icon in Alert iconReactNode-×
messageContent of Alert, please use title insteadReactNode-—
onCloseCallback when Alert is closed, please use closable.onClose instead(e: MouseEvent) => void-—
closeIconCustom close icon, please use closable.closeIcon insteadReactNode--
closeTextClose text to show, please use closable.closeIcon insteadReactNode--
showIconWhether to show iconbooleanfalse, in banner mode default is true—
stylesCustomize inline style for each semantic structure inside the component. Supports object or functionRecord<SemanticDOM, CSSProperties> | (info: { props }) => Record<SemanticDOM, CSSProperties>-—
successIcon(Only supports global configuration) Custom success icon in Alert iconReactNode-×
titleContent of AlertReactNode-—
typeType of Alert styles, options: success, info, warning, errorstringinfo, in banner mode default is warning—
warningIcon(Only supports global configuration) Custom warning icon in Alert iconReactNode-×

ClosableType

PropertyDescriptionTypeDefaultVersion
afterCloseCalled when close animation is finishedfunction--
closeIconCustom close iconReactNode--
onCloseCallback when Alert is closed(e: MouseEvent) => void--

Alert.ErrorBoundary

PropertyDescriptionTypeDefaultVersion
descriptionCustom error description to showReactNode{{ error stack }}—
messageCustom error message to show, please use title insteadReactNode{{ error }}—
titleCustom error title to showReactNode{{ error }}—