mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-22 22:48:29 +08:00
8b1f79c1f5
* demo: update demo type React.ReactNode => React.PropsWithChildren * fix: fix
61 lines
1.5 KiB
TypeScript
61 lines
1.5 KiB
TypeScript
import React from 'react';
|
|
import { Col, Divider, Row } from 'antd';
|
|
|
|
const DemoBox: React.FC<React.PropsWithChildren<{ value: number }>> = (props) => (
|
|
<p className={`height-${props.value}`}>{props.children}</p>
|
|
);
|
|
|
|
const App: React.FC = () => (
|
|
<>
|
|
<Divider orientation="left">Align Top</Divider>
|
|
<Row justify="center" align="top">
|
|
<Col span={4}>
|
|
<DemoBox value={100}>col-4</DemoBox>
|
|
</Col>
|
|
<Col span={4}>
|
|
<DemoBox value={50}>col-4</DemoBox>
|
|
</Col>
|
|
<Col span={4}>
|
|
<DemoBox value={120}>col-4</DemoBox>
|
|
</Col>
|
|
<Col span={4}>
|
|
<DemoBox value={80}>col-4</DemoBox>
|
|
</Col>
|
|
</Row>
|
|
|
|
<Divider orientation="left">Align Middle</Divider>
|
|
<Row justify="space-around" align="middle">
|
|
<Col span={4}>
|
|
<DemoBox value={100}>col-4</DemoBox>
|
|
</Col>
|
|
<Col span={4}>
|
|
<DemoBox value={50}>col-4</DemoBox>
|
|
</Col>
|
|
<Col span={4}>
|
|
<DemoBox value={120}>col-4</DemoBox>
|
|
</Col>
|
|
<Col span={4}>
|
|
<DemoBox value={80}>col-4</DemoBox>
|
|
</Col>
|
|
</Row>
|
|
|
|
<Divider orientation="left">Align Bottom</Divider>
|
|
<Row justify="space-between" align="bottom">
|
|
<Col span={4}>
|
|
<DemoBox value={100}>col-4</DemoBox>
|
|
</Col>
|
|
<Col span={4}>
|
|
<DemoBox value={50}>col-4</DemoBox>
|
|
</Col>
|
|
<Col span={4}>
|
|
<DemoBox value={120}>col-4</DemoBox>
|
|
</Col>
|
|
<Col span={4}>
|
|
<DemoBox value={80}>col-4</DemoBox>
|
|
</Col>
|
|
</Row>
|
|
</>
|
|
);
|
|
|
|
export default App;
|