mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 20:19:44 +08:00
3c28b3eb9e
* chore: use flex align center instead * test: update test case * chore: adjust space align * chore: fix missing selector * chore: revert space modify * chore: offset cal
60 lines
1.2 KiB
TypeScript
60 lines
1.2 KiB
TypeScript
import { Checkbox, ConfigProvider, Radio, Space } from 'antd';
|
|
import React from 'react';
|
|
|
|
const sharedStyle: React.CSSProperties = {
|
|
border: '1px solid red',
|
|
marginBottom: 16,
|
|
};
|
|
|
|
const App: React.FC = () => (
|
|
<div>
|
|
<Space style={sharedStyle} align="center">
|
|
<Checkbox value="light" />
|
|
<div>Bamboo</div>
|
|
<Checkbox value="little">Little</Checkbox>
|
|
</Space>
|
|
|
|
<Space style={sharedStyle} align="center">
|
|
<Radio value="light" />
|
|
<div>Bamboo</div>
|
|
<Radio value="little">Little</Radio>
|
|
</Space>
|
|
|
|
<div
|
|
style={{
|
|
...sharedStyle,
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
}}
|
|
>
|
|
<Checkbox value="light" />
|
|
<div>Bamboo</div>
|
|
<Checkbox value="little">Little</Checkbox>
|
|
</div>
|
|
|
|
<div
|
|
style={{
|
|
...sharedStyle,
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
}}
|
|
>
|
|
<Radio value="light" />
|
|
<div>Bamboo</div>
|
|
<Radio value="little">Little</Radio>
|
|
</div>
|
|
|
|
<ConfigProvider
|
|
theme={{
|
|
token: {
|
|
controlHeight: 48,
|
|
},
|
|
}}
|
|
>
|
|
<Checkbox>Aligned</Checkbox>
|
|
</ConfigProvider>
|
|
</div>
|
|
);
|
|
|
|
export default App;
|