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

List

원문 보기 위키 갱신

List (리스트)

List는 가장 기본이 되는 목록 표시 컴포넌트예요. 텍스트나 사진, 문단을 담을 수 있어서 데이터 표시 화면에서 자주 사용됩니다.

출처: 문서

본문

API

List

속성 설명 타입 기본값 버전
bordered 테두리를 그릴지 여부 boolean true -
hoverable 목록 항목에 hover 스타일을 줄지 여부 boolean - 2.9.0
loading 목록 내용을 불러 오는 동안 로딩 인디케이터를 표시할지 여부 boolean - -
split 목록 항목 아래에 구분선을 그릴지 여부 boolean true -
defaultCurrent 기본 현재 페이지를 설정해요 number 1 -
offsetBottom onReachBottom이 발동되는 거리 임계값 number 0 -
throttleDelay onListScroll의 스로틀 간격 number 500 -
size List 크기 'small' | 'default' | 'large' - -
children List의 자식 요소. dataSource와 render가 있을 때는 이 파라미터를 쓰지 마세요 ReactNode - -
footer List의 푸터 ReactNode - -
header List의 헤더 ReactNode - -
noDataElement 데이터가 없을 때 표시할 내용 ReactNode - -
scrollLoading 스크롤 중에 데이터를 불러올 때 목록 맨 아래에 둘 내용을 설정해요 string | ReactNode - -
className 추가 css 클래스 string | string[] - -
dataSource 목록을 렌더링할 데이터 소스. children이 있으면 이 파라미터는 생략할 수 있어요 (dataSource 쪽이 우선순위가 높아요) T[] - -
grid 목록의 그리드 형태 ListGridProps - column in 2.20.0
listRef 현재 목록에 대한 참조 MutableRefObject<ListHandle> - 2.20.0
pagination 페이지를 나눌지 여부. Pagination 설정을 함께 넘길 수도 있어요 boolean | PaginationProps - -
style 추가 스타일 CSSProperties - -
virtualListProps 가상 리스트(virtual-list) 속성을 넘겨요. 이 파라미터를 넘기면 가상 스크롤이 켜져요 AvailableVirtualListProps - 2.11.0
wrapperClassName 래퍼(wrapper) 요소에 줄 추가 css 클래스 string | string[] - -
wrapperStyle 래퍼(wrapper) 요소에 줄 추가 css 스타일 CSSProperties - -
onListScroll 목록이 스크롤될 때 호출되는 콜백. onReachBottom으로 충분하지 않을 때 스크롤 감시 함수를 직접 만들 수 있어요 (elem: Element) => void - -
onReachBottom 목록이 맨 아래까지 스크롤됐을 때 호출되는 콜백 (currentPage: number) => void - -
render dataSource를 사용할 때 목록 항목을 커스터마이즈해요 (item: T, index: number) => ReactNode - -

List.Item

속성 설명 타입 기본값
actionLayout 목록 동작(operations) 그룹의 위치. horizontal이면 오른쪽, vertical이면 아래에 놓여요. 'horizontal' | 'vertical' horizontal
extra 목록 항목의 가장 오른쪽에 놓이는 추가 콘텐츠 ReactNode -
actions 목록 항목의 동작(operations) 그룹 ReactNode[] -
className 추가 css 클래스 string | string[] -
style 추가 스타일 CSSProperties -

List.Item.Meta

속성 설명 타입 기본값
avatar 목록 항목의 아바타 ReactNode -
description 목록 항목의 설명 ReactNode -
title 목록 항목의 제목 ReactNode -
className 추가 css 클래스 string | string[] -
style 추가 스타일 CSSProperties -

ListGridProps

type ListGridProps = {
  column?: number;
} & Pick<RowProps, "gutter" | "justify" | "align"> &
  Pick<
    ColProps,
    "span" | "offset" | "order" | "pull" | "push" | GridResponsiveBreakpoint
  >;

ListHandle

export type ListHandle = {
  dom: HTMLDivElement;
  scrollIntoView: (index: number) => void;
};

AvailableVirtualListProps

export type AvailableVirtualListProps = Pick<
  VirtualListProps<any>,
  | "height"
  | "itemHeight"
  | "threshold"
  | "isStaticItemHeight"
  | "scrollOptions"
  | "onScroll"
  | "wrapperChild"
>;

<ListGridProps>

속성 설명 타입 기본값
gutter 그리드 사이 간격 number -
span 셀이 차지할 래스터 칸 수 number -
xs xs에 적용할 span number -
sm sm에 적용할 span number -
md md에 적용할 span number -
lg lg에 적용할 span number -
xl xl에 적용할 span number -
xxl xxl에 적용할 span number -

VirtualListProps

속성 설명 타입 기본값
height 보이는 영역의 높이 (2.11.0부터 80% 같은 string 타입도 지원해요) number 200
threshold 가상 스크롤을 자동으로 켜는 요소 수 임계값. null을 넘기면 가상 스크롤이 꺼져요. number | null 100
isStaticItemHeight 모든 항목의 높이가 같은 정적 항목인지 여부 boolean true

더 알아보기

List 컴포넌트의 더 자세한 내용은 Arco Design 공식 문서에서 확인해 보세요.