Skip to main content
Version: Next

Alert

Alert component for displaying important messages to users. Wraps Ant Design Alert with sensible defaults and improved accessibility.

Live Example​

Loading component...

Try It​

Edit the code below to experiment with the component:

Live Editor
function Demo() {
  return (
    <Alert
      closable
      type="info"
      message="This is a sample alert message."
      description="Sample description for additional context."
      showIcon
    />
  );
}
Result
Loading...

Props​

PropTypeDefaultDescription
closablebooleantrueWhether the Alert can be closed with a close button.
typestring"info"Type of the alert (e.g., info, error, warning, success).
messagestring"This is a sample alert message."Message
descriptionstring"Sample description for additional context."Description
showIconbooleantrueWhether to display an icon in the Alert.

Usage in Extensions​

This component is available in the @apache-superset/core/components package, which is automatically available to Superset extensions.

import { Alert } from '@apache-superset/core/components';

function MyExtension() {
return (
<Alert closable type="info" message="This is a sample alert message." />
);
}

This page was auto-generated from the component's Storybook story.