ant-design/components/input/demo/compact-style.tsx
JiaQi 2bc16980ab
docs(input): Added Space.Compact recommendations (#41080)
* docs(input): Added Space.Compact recommendations

* chore: warning for deprecated

---------

Co-authored-by: 二货机器人 <smith3816@gmail.com>
2023-03-09 21:26:56 +08:00

41 lines
1.0 KiB
TypeScript

import { Button, Input, Select, Space } from 'antd';
import React from 'react';
const { Search } = Input;
const options = [
{
value: 'zhejiang',
label: 'Zhejiang',
},
{
value: 'jiangsu',
label: 'Jiangsu',
},
];
const App: React.FC = () => (
<Space direction="vertical" size="middle">
<Space.Compact>
<Input defaultValue="26888888" />
</Space.Compact>
<Space.Compact>
<Input style={{ width: '20%' }} defaultValue="0571" />
<Input style={{ width: '80%' }} defaultValue="26888888" />
</Space.Compact>
<Space.Compact>
<Search addonBefore="https://" placeholder="input search text" allowClear />
</Space.Compact>
<Space.Compact style={{ width: '100%' }}>
<Input defaultValue="Combine input and button" />
<Button type="primary">Submit</Button>
</Space.Compact>
<Space.Compact>
<Select defaultValue="Zhejiang" options={options} />
<Input defaultValue="Xihu District, Hangzhou" />
</Space.Compact>
</Space>
);
export default App;