ant-design/components/notification/demo/with-icon.md
xrkffgg 01b98e79d9
docs: optimize site of components 3 (#23779)
* docs: optimize site of components in rtl 3

* add
2020-04-30 21:04:19 +08:00

895 B

order title
2
zh-CN en-US
带有图标的通知提醒框 Notification with icon

zh-CN

通知提醒框左侧有图标。

en-US

A notification box with a icon at the left side.

import { Button, notification, Space } from 'antd';

const openNotificationWithIcon = type => {
  notification[type]({
    message: 'Notification Title',
    description:
      'This is the content of the notification. This is the content of the notification. This is the content of the notification.',
  });
};

ReactDOM.render(
  <Space>
    <Button onClick={() => openNotificationWithIcon('success')}>Success</Button>
    <Button onClick={() => openNotificationWithIcon('info')}>Info</Button>
    <Button onClick={() => openNotificationWithIcon('warning')}>Warning</Button>
    <Button onClick={() => openNotificationWithIcon('error')}>Error</Button>
  </Space>,
  mountNode,
);