close
dumi-theme-easyxaidumi-theme-easyxai
⌘ K
Guide
Components
Config
Config
Document Configuration
Custom
ApiHeader
Configuration
Footer
PREV
Document Configuration
NEXT
Footer

相关资源

Ant Design
Ant Design Pro
Ant Design Pro Components
Umi-React 应用开发框架
Dumi-组件/文档研发工具
qiankun-微前端框架

社区

Medium
Twitter
yuqueAnt Design 语雀专栏
Ant Design 知乎专栏
体验科技专栏
seeconfSEE Conf-SEE Conf-蚂蚁体验科技大会

帮助

GitHub
更新日志
讨论

more products更多产品

yuque语雀-知识创作与分享工具
AntVAntV-数据可视化解决方案
EggEgg-企业级 Node.js 框架
kitchenKitchen-Sketch 工具集
xtech蚂蚁体验科技
Copyright © 2022-2025
Made with ❤️ by Easyxai FE Team
‌
‌
‌
‌

Custom ApiHeader

In some business scenarios, users of the theme package may need to customize some content in ApiHeader. This can be achieved by customizing the slot.

Create a ApiHeader folder in the .dumi/theme/slots directory and add an index.tsx file. Then add the following code to customize the display of ApiHeader:

//.dumi/theme/slots/ApiHeader/index.tsx
import { FC, memo } from 'react';
import { SmileOutlined } from '@ant-design/icons';
import { ApiHeader as Header, siteSelectors, useSiteStore } from '@easyx.ai/dumi-theme-easyxai';
const ApiHeader: FC = memo(() => {
const props = useSiteStore(siteSelectors.apiHeader);
const { pkg } = props;
const packages = [
{
label: 'icon',
icon: <SmileOutlined />,
children: 'demo',
url: `https://www.npmjs.com/package/${pkg}`,
},
];
return <Header serviceList={packages} {...props} />;
});
export default ApiHeader;

For the complete configuration of the ApiHeader component, please refer to the ApiHeader component documentation.