ant-design/components/tabs/demo/icon.md
2022-05-23 14:37:16 +08:00

687 B

order title
2
zh-CN en-US
图标 Icon

zh-CN

有图标的标签。

en-US

The Tab with Icon.

import { AndroidOutlined, AppleOutlined } from '@ant-design/icons';
import { Tabs } from 'antd';
import React from 'react';

const { TabPane } = Tabs;

const App: React.FC = () => (
  <Tabs defaultActiveKey="2">
    <TabPane
      tab={
        <span>
          <AppleOutlined />
          Tab 1
        </span>
      }
      key="1"
    >
      Tab 1
    </TabPane>
    <TabPane
      tab={
        <span>
          <AndroidOutlined />
          Tab 2
        </span>
      }
      key="2"
    >
      Tab 2
    </TabPane>
  </Tabs>
);

export default App;