--- order: 6 title: zh-CN: 自定义图标 en-US: Customize Icon --- ## zh-CN 可以针对不同的节点定制图标。 ## en-US You can customize icons for different nodes. ```tsx import React from 'react'; import { Tree } from 'antd'; import { DownOutlined, FrownOutlined, SmileOutlined, MehOutlined, FrownFilled, } from '@ant-design/icons'; import type { DataNode } from 'antd/lib/tree'; const treeData: DataNode[] = [ { title: 'parent 1', key: '0-0', icon: , children: [ { title: 'leaf', key: '0-0-0', icon: , }, { title: 'leaf', key: '0-0-1', icon: ({ selected }) => (selected ? : ), }, ], }, ]; const App: React.FC = () => ( } treeData={treeData} /> ); export default App; ```