mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-15 17:31:25 +08:00
bd36fba393
* fix: fix checkbox align issue * fix: use center * chore: comment * fix: use align-self: center * chore: add snapshot * fix: tree checkbox
68 lines
1.3 KiB
TypeScript
68 lines
1.3 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>
|
|
|
|
<div>
|
|
<ConfigProvider
|
|
theme={{
|
|
token: {
|
|
controlHeight: 48,
|
|
},
|
|
}}
|
|
>
|
|
<Checkbox>Aligned</Checkbox>
|
|
</ConfigProvider>
|
|
</div>
|
|
|
|
<div>
|
|
<Checkbox>
|
|
<span style={{ fontSize: 32 }}>Aligned</span>
|
|
</Checkbox>
|
|
</div>
|
|
</div>
|
|
);
|
|
|
|
export default App;
|