ant-design/components/space/demo/customize.md
2022-04-28 20:54:19 +08:00

653 B

order title
3
zh-CN en-US
自定义尺寸 Customize Size

zh-CN

自定义间距大小。

en-US

Custom spacing size.

import React, { useState } from 'react';
import { Space, Slider, Button } from 'antd';

function App() {
  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;