UNPKG

1.39 kBTypeScriptView Raw
1import * as React from 'react';
2import type { ClosableType } from '../_util/hooks/useClosable';
3export interface AlertProps {
4 /** Type of Alert styles, options:`success`, `info`, `warning`, `error` */
5 type?: 'success' | 'info' | 'warning' | 'error';
6 /** Whether Alert can be closed */
7 closable?: ClosableType;
8 /**
9 * @deprecated please use `closable.closeIcon` instead.
10 * Close text to show
11 */
12 closeText?: React.ReactNode;
13 /** Content of Alert */
14 message?: React.ReactNode;
15 /** Additional content of Alert */
16 description?: React.ReactNode;
17 /** Callback when close Alert */
18 onClose?: React.MouseEventHandler<HTMLButtonElement>;
19 /** Trigger when animation ending of Alert */
20 afterClose?: () => void;
21 /** Whether to show icon */
22 showIcon?: boolean;
23 /** https://www.w3.org/TR/2014/REC-html5-20141028/dom.html#aria-role-attribute */
24 role?: string;
25 style?: React.CSSProperties;
26 prefixCls?: string;
27 className?: string;
28 rootClassName?: string;
29 banner?: boolean;
30 icon?: React.ReactNode;
31 closeIcon?: React.ReactNode;
32 action?: React.ReactNode;
33 onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
34 onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
35 onClick?: React.MouseEventHandler<HTMLDivElement>;
36}
37declare const Alert: React.FC<AlertProps>;
38export default Alert;