mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 17:19:11 +08:00
1b479c4b45
* feat(collapse): migrate less to token * docs: add component token demo * test: update snapshot * chore: update snapshot * chore: code clean * chore: code clean * chore: update * chore: update demo * chore: style * chore: fix lint --------- Co-authored-by: MadCcc <1075746765@qq.com>
31 lines
821 B
TypeScript
31 lines
821 B
TypeScript
import React from 'react';
|
|
import { Collapse, ConfigProvider } from 'antd';
|
|
|
|
/** Test usage. Do not use in your production. */
|
|
import type { CollapseProps } from 'antd';
|
|
|
|
const text = `Ant Design! `.repeat(26);
|
|
|
|
const items: CollapseProps['items'] = [
|
|
{ key: '1', label: `This is panel header 1, (${text})`, children: text },
|
|
{ key: '2', label: `This is panel header 2, (${text})`, children: text },
|
|
{ key: '3', label: `This is panel header 3, (${text})`, children: text },
|
|
];
|
|
|
|
export default () => (
|
|
<ConfigProvider
|
|
theme={{
|
|
components: {
|
|
Collapse: {
|
|
headerPadding: '0px 10px 20px 30px',
|
|
headerBg: '#eaeeff',
|
|
contentPadding: '0px 10px 20px 30px',
|
|
contentBg: '#e6f7ff',
|
|
},
|
|
},
|
|
}}
|
|
>
|
|
<Collapse items={items} />
|
|
</ConfigProvider>
|
|
);
|