본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

파일 카드

원문 보기 위키 갱신

파일 카드 (FileCard)

파일을 카드 형태로 표시하는 컴포넌트예요. 대화나 입력 과정에서 파일을 보여 줄 때 사용해요.

출처: 문서

본문

언제 사용하나요?

  • 대화 중이나 입력 중에 파일을 표시할 때 사용해요.

예제

데모는 원문 문서에서 확인할 수 있어요.

API

공통 props 참고: Common props

FileCardProps

속성 설명 타입 기본값 버전
name 파일 이름이에요 string - -
byte 파일 크기(바이트)예요 number - -
size 카드 크기예요 'small' | 'default' 'default' -
description 파일 설명이에요. 함수 형태로 컨텍스트 정보를 받을 수 있어요 React.ReactNode | ((info: { size: string, icon: React.ReactNode, namePrefix?: string, nameSuffix?: string, name?: string, src?: string, type?: string }) => React.ReactNode) - -
loading 로딩 상태예요 boolean false -
type 파일 유형이에요 'file' | 'image' | 'audio' | 'video' | string - -
src 이미지나 파일의 URL이에요 string - -
mask 마스크 콘텐츠예요. 함수 형태로 컨텍스트 정보를 받을 수 있어요. type="image"일 때는 imageProps.preview.mask로 설정하고, 이 prop은 이미지가 아닌 파일 유형에만 적용돼요 React.ReactNode | ((info: { size: string, icon: React.ReactNode, namePrefix?: string, nameSuffix?: string, name?: string, src?: string, type?: string }) => React.ReactNode) - -
icon 커스텀 아이콘이에요 React.ReactNode | PresetIcons - -
imageProps 이미지 props 설정이에요 Image - -
videoProps 비디오 props 설정이에요 Partial<React.JSX.IntrinsicElements['video']> - -
audioProps 오디오 props 설정이에요 Partial<React.JSX.IntrinsicElements['audio']> - -
spinProps 로딩 애니메이션 props 설정이에요 SpinProps & { showText?: boolean; icon?: React.ReactNode } - -
onClick 클릭 이벤트 콜백이에요. 파일 정보와 클릭 이벤트를 받아요 (info: { size: string, icon: React.ReactNode, namePrefix?: string, nameSuffix?: string, name?: string, src?: string, type?: string }, event: React.MouseEvent<HTMLDivElement>) => void - -

PresetIcons

미리 정의된 아이콘 타입으로, 다음 값을 지원해요:

type PresetIcons =
  | 'default' // Default file icon
  | 'excel' // Excel file icon
  | 'image' // Image file icon
  | 'markdown' // Markdown file icon
  | 'pdf' // PDF file icon
  | 'ppt' // PowerPoint file icon
  | 'word' // Word file icon
  | 'zip' // Archive file icon
  | 'video' // Video file icon
  | 'audio' // Audio file icon
  | 'java' // Java file icon
  | 'javascript' // JavaScript file icon
  | 'python'; // Python file icon

FileCard.List

여러 개의 파일 카드를 표시하는 파일 목록 컴포넌트예요.

속성 설명 타입 기본값 버전
items 파일 목록 데이터예요 FileCardProps[] - -
size 카드 크기예요 'small' | 'default' 'default' -
removable 제거 가능 여부예요 boolean | ((item: FileCardProps) => boolean) false -
onRemove 제거 이벤트 콜백이에요 (item: FileCardProps) => void - -
extension 확장 콘텐츠예요 React.ReactNode - -
overflow 넘침(overflow) 표시 방식이에요 'scrollX' | 'scrollY' | 'wrap' 'wrap' -

Semantic DOM

FileCard

데모는 원문 문서에서 확인할 수 있어요.

FileCard.List

데모는 원문 문서에서 확인할 수 있어요.

Design Token

토큰 테이블은 원문 문서에서 확인할 수 있어요.

더 알아보기

입력창에 첨부를 붙이는 방법은 Attachment 문서를 참고하세요. 메시지 말풍선 구성은 Bubble 문서를 함께 보면 좋아요.