--- order: 4 title: zh-CN: 信息预览抽屉 en-US: Preview drawer --- ## zh-CN 需要快速预览对象概要时使用,点击遮罩区关闭。 ## en-US Use Drawer to quickly preview details of an object, such as those in a list. ```tsx import { Avatar, Col, Divider, Drawer, List, Row } from 'antd'; import React, { useState } from 'react'; interface DescriptionItemProps { title: string; content: React.ReactNode; } const DescriptionItem = ({ title, content }: DescriptionItemProps) => (

{title}:

{content}
); const App: React.FC = () => { const [open, setOpen] = useState(false); const showDrawer = () => { setOpen(true); }; const onClose = () => { setOpen(false); }; return ( <> ( View Profile , ]} > } title={{item.name}} description="Progresser XTech" /> )} />

User Profile

Personal

Company

Lin} />

Contacts

github.com/ant-design/ant-design/ } />
); }; export default App; ``` ```css .site-description-item-profile-wrapper { margin-bottom: 7px; color: rgba(0, 0, 0, 0.65); font-size: 14px; line-height: 1.5715; } [data-theme='compact'] .site-description-item-profile-wrapper { font-size: 12px; line-height: 1.66667; } .ant-drawer-body p.site-description-item-profile-p { display: block; margin-bottom: 16px; color: rgba(0, 0, 0, 0.85); font-size: 16px; line-height: 1.5715; } [data-theme='compact'] .ant-drawer-body p.site-description-item-profile-p { font-size: 14px; line-height: 1.66667; } .site-description-item-profile-p-label { display: inline-block; margin-right: 8px; color: rgba(0, 0, 0, 0.85); } ```