---
order: 7
title:
zh-CN: 自定义位置
en-US: To customize the position of modal
---
## zh-CN
使用 `centered` 或类似 `style.top` 的样式来设置对话框位置。
## en-US
You can use `centered`,`style.top` or other styles to set position of modal dialog.
```tsx
import { Button, Modal } from 'antd';
import React, { useState } from 'react';
const App: React.FC = () => {
const [modal1Visible, setModal1Visible] = useState(false);
const [modal2Visible, setModal2Visible] = useState(false);
return (
<>
setModal1Visible(false)}
onCancel={() => setModal1Visible(false)}
>
some contents...
some contents...
some contents...
setModal2Visible(false)}
onCancel={() => setModal2Visible(false)}
>
some contents...
some contents...
some contents...
>
);
};
export default App;
```