Attachments
Attachments
Display the collection of attachment information.
Importimport { Attachments } from "@ant-design/x"; |
Sourcecomponents/attachments |
Docs |
Importimport { Attachments } from "@ant-design/x"; |
Sourcecomponents/attachments |
Docs |
The Attachments component is used in scenarios where a collection of attachment information needs to be displayed.
Common props ref: Common props.
Inherits antd Upload properties.
| Property | Description | Type | Default | Version |
|---|---|---|---|---|
| classNames | Custom class names, see below | Record<string, string> | - | - |
| disabled | Whether to disable | boolean | false | - |
| getDropContainer | Config the area where files can be dropped | () => HTMLElement | - | - |
| items | Attachment list, same as Upload fileList | Attachment[] | - | - |
| overflow | Behavior when the file list overflows | 'wrap' | 'scrollX' | 'scrollY' | - | - |
| placeholder | Placeholder information when there is no file | PlaceholderType | ((type: 'inline' | 'drop') => PlaceholderType) | - | - |
| rootClassName | Root node className | string | - | - |
| styles | Custom style object, see below | Record<string, React.CSSProperties> | - | - |
| imageProps | Image config, same as antd Image | ImageProps | - | - |
interface PlaceholderType {icon?: React.ReactNode;title?: React.ReactNode;description?: React.ReactNode;}### AttachmentsRef| Property | Description | Type | Version || ------------- | ---------------------- | -------------------- | ------- || nativeElement | Get the native node | HTMLElement | - || fileNativeElement | Get the file upload native node | HTMLElement | - || upload | Manually upload a file | (file: File) => void | - || select | Manually select files | (options: { accept?: string; multiple?: boolean; }) => void | - |## Semantic DOM<code src="./demo/_semantic.tsx" simplify="true"></code>## Design Token<ComponentTokenTable component="Attachments"></ComponentTokenTable>