첨부 파일
첨부 파일 (Attachments)
첨부 파일(Attachments) 컴포넌트는 첨부 정보 모음을 보여줘요. 업로드한 파일 목록이나 대화에서 주고받은 첨부물을 표시하는 데 사용돼요.
출처: 문서
본문
언제 사용하나요
Attachments 컴포넌트는 첨부 정보 모음을 표시해야 하는 시나리오에서 사용돼요.
예시
API
공통 props 참고: Common props.
AttachmentsProps
antd Upload의 속성을 상속해요.
| Property | Description | Type | Default | Version |
|---|---|---|---|---|
| classNames | 커스텀 클래스 이름, 아래 참고 | Record<string, string> | - | - |
| disabled | 비활성화할지 여부 | boolean | false | - |
| maxCount | 업로드할 수 있는 최대 파일 수 | number | - | - | 2.0.0 |
| getDropContainer | 파일을 드롭할 수 있는 영역을 설정 | () => HTMLElement | - | - |
| items | 첨부 목록, Upload의 fileList와 동일 |
Attachment[] | - | - |
| overflow | 파일 목록이 넘칠 때의 동작 | 'wrap' | 'scrollX' | 'scrollY' | - | - |
| placeholder | 파일이 없을 때의 플레이스홀더 정보 | PlaceholderType | ((type: 'inline' | 'drop') => PlaceholderType) | - | - |
| rootClassName | 루트 노드 className | string | - | - |
| styles | 커스텀 스타일 객체, 아래 참고 | Record<string, React.CSSProperties> | - | - |
| imageProps | 이미지 설정, antd Image와 동일 | ImageProps | - | - |
interface PlaceholderType {
icon?: React.ReactNode;
title?: React.ReactNode;
description?: React.ReactNode;
}
AttachmentsRef
| Property | Description | Type | Version |
|---|---|---|---|
| nativeElement | 네이티브 노드를 가져옴 | HTMLElement | - |
| fileNativeElement | 파일 업로드 네이티브 노드를 가져옴 | HTMLElement | - |
| upload | 파일을 수동으로 업로드 | (file: File) => void | - |
| select | 파일을 수동으로 선택 | (options: { accept?: string; multiple?: boolean; }) => void | 2.0.0 |
시맨틱 DOM
Design Token
더 알아보기
첨부 파일과 함께 보내는 입력 박스는 Sender 계열 문서를 참고하세요. 선택 옵션을 보여주는 UI는 Suggestion 문서를 확인하세요.