ant-design/components/alert/demo/banner.md
2022-05-21 22:14:15 +08:00

677 B

order iframe title
6 250
zh-CN en-US
顶部公告 Banner

zh-CN

页面顶部通告形式,默认有图标且 type 为 'warning'。

en-US

Display Alert as a banner at top of page.

import { Alert } from 'antd';
import React from 'react';

const App: React.FC = () => (
  <>
    <Alert message="Warning text" banner />
    <br />
    <Alert
      message="Very long warning text warning text text text text text text text"
      banner
      closable
    />
    <br />
    <Alert showIcon={false} message="Warning text without icon" banner />
    <br />
    <Alert type="error" message="Error text" banner />
  </>
);

export default App;