ant-design/components/tabs/demo/icon.md
二货爱吃白萝卜 628968f460
feat: Tabs support items (#36889)
* refactor: Using items

* docs: replace with items

* docs: deprecated demo

* test: Update snapshot

* docs: simple basic demo

* test: coverage
2022-08-05 10:49:08 +08:00

627 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 App: React.FC = () => (
  <Tabs
    defaultActiveKey="2"
    items={[AppleOutlined, AndroidOutlined].map((Icon, i) => {
      const id = String(i + 1);

      return {
        label: (
          <span>
            <Icon />
            Tab {id}
          </span>
        ),
        key: id,
        children: `Tab ${id}`,
      };
    })}
  />
);

export default App;