ant-design/components/space/demo/customize.md
2022-05-21 22:14:15 +08:00

40 lines
667 B
Markdown

---
order: 3
title:
zh-CN: 自定义尺寸
en-US: Customize Size
---
## zh-CN
自定义间距大小。
## en-US
Custom spacing size.
```tsx
import { Button, Slider, Space } from 'antd';
import React, { useState } from 'react';
const App: React.FC = () => {
const [size, setSize] = useState(8);
return (
<>
<Slider value={size} onChange={value => setSize(value)} />
<br />
<br />
<Space size={size}>
<Button type="primary">Primary</Button>
<Button>Default</Button>
<Button type="dashed">Dashed</Button>
<Button type="link">Link</Button>
</Space>
</>
);
};
export default App;
```