ant-design/components/checkbox/demo/debug-line.md
二货机器人 7c2c49316b
fix: checkbox & radio in flex align (#30260)
* fix: checkbox & radio in flex align

* rm only md

* docs: Update doc

* test: Update snapshot
2021-04-22 20:15:23 +08:00

1.1 KiB

order title debug
99
zh-CN en-US
同行布局 Same line
true

zh-CN

同行布局

en-US

Same line

import { Checkbox, Radio, Space } from 'antd';

const sharedStyle: React.CSSProperties = {
  border: '1px solid red',
  marginBottom: 16,
};

ReactDOM.render(
  <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>,
  mountNode,
);