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 message="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 message="Info" type="info" />
<Alert message="Success" type="success" />
<Alert message="Warning" type="warning" />
<Alert message="Error" type="error" />
</Space>
);
}

With Description

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

API

PropTypeDefaultDescription
messageReactNodeAlert title
descriptionReactNodeAdditional content
type'success' | 'info' | 'warning' | 'error''info'Alert type
showIconbooleanfalseShow type icon
closablebooleanfalseShow close button
onClose(e) => voidClose callback
bannerbooleanfalseFull-width banner style
actionReactNodeAction element