--- order: 1 title: zh-CN: 自定义位置 en-US: Custom Placement --- ## zh-CN 自定义位置,点击触发按钮抽屉从相应的位置滑出,点击遮罩区关闭。 ## en-US The Drawer can appear from any edge of the screen. ```tsx import type { DrawerProps, RadioChangeEvent } from 'antd'; import { Button, Drawer, Radio, Space } from 'antd'; import React, { useState } from 'react'; const App: React.FC = () => { const [open, setOpen] = useState(false); const [placement, setPlacement] = useState('left'); const showDrawer = () => { setOpen(true); }; const onClose = () => { setOpen(false); }; const onChange = (e: RadioChangeEvent) => { setPlacement(e.target.value); }; return ( <> top right bottom left

Some contents...

Some contents...

Some contents...

); }; export default App; ```