Skip to main content

Alert

Displays a prominent message for user attention.

Source: Re-exported from antd. Full documentation: Ant Design Alert

Basic Usage

import { Alert } from '@vef-framework-react/components';

export default function Demo() {
return <Alert title="Success message" type="success" />;
}

Types

import { Alert, Space } from '@vef-framework-react/components';

export default function Demo() {
return (
<Space direction="vertical" style={{ width: '100%' }}>
<Alert title="Info" type="info" />
<Alert title="Success" type="success" />
<Alert title="Warning" type="warning" />
<Alert title="Error" type="error" />
</Space>
);
}

With Description

<Alert
title="Warning"
description="This action may affect other users."
type="warning"
showIcon
closable
/>

Variant

<Alert title="Filled variant" type="warning" variant="filled" />

API

PropTypeDefaultDescription
titleReactNodeAlert content (the primary title prop; message is a deprecated alias)
messageReactNodeDeprecated. Use title instead
descriptionReactNodeAdditional content
type'success' | 'info' | 'warning' | 'error''info'Alert type
variant'outlined' | 'filled'Visual variant (antd 6.4+)
iconReactNodeCustom icon (shown when showIcon is set)
showIconbooleanfalseShow type icon
closableboolean | ({ closeIcon?, onClose? } & ...)falseShow close button; pass an object to customize the close icon or handle close via closable.onClose
onClose(e) => voidDeprecated. Use closable.onClose instead
bannerbooleanfalseFull-width banner style
actionReactNodeAction element