페이지네이션
페이지네이션 (Pagination)
페이지네이션은 페이지가 나뉜 콘텐츠를 탐색할 수 있게 해주는 컴포넌트예요. 페이지 표시와 이동 컨트롤을 제공한답니다.
출처: 문서
본문
Pagination 컴포넌트
페이지네이션 컨트롤을 위한 컴포넌트예요.
- 키워드: pagination, pages, navigation, paging, controls
- 카테고리: navigation
- 상태: general-availability
예시
import Pagination from '@atlaskit/pagination/pagination';
const Examples = (): React.JSX.Element => (
<>
<Pagination
pages={[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}
defaultSelectedIndex={2}
max={7}
onChange={(_event, page) => console.log('Page selected:', page)}
/>
<Pagination
pages={['A', 'B', 'C', 'D']}
defaultSelectedIndex={1}
onChange={(_event, page) => console.log('Letter page:', page)}
/>
</>
);
export default Examples;
Props
| Prop | Type | Description |
|---|---|---|
components |
{ Page?: React.ElementType<any, keyof React.JSX.IntrinsicElements>; Previous?: React.ElementType<any, keyof React.JSX.IntrinsicElements>; Next?: React.ElementType<...>; } |
Replace the built-in page, previous, next and/ or ellipsis component |
defaultSelectedIndex |
number |
Index of the page to be selected by default |
getPageLabel |
(page: T, pageIndex: number) => string | number |
Helper function to get text displayed on the page button |
isDisabled |
boolean |
Sets whether the Paginator is disabled |
label |
string |
The aria-label for the pagination nav wrapper |
max |
number |
Maximum number of pages to be displayed in the pagination |
nextLabel |
string |
The aria-label for the next button |
onChange |
(event: React.SyntheticEvent<Element, Event>, page: T, analyticsEvent?: UIAnalyticsEvent) => void |
The onChange handler which is called when the page is changed |
pageLabel |
string |
The aria-label for the individual page numbers |
pages |
T[] |
Array of the pages to display (required) |
previousLabel |
string |
The aria-label for the previous button |
renderEllipsis |
(arg: { key: string; from: number; to: number; }) => React.ReactElement<any, string | React.JSXElementConstructor<any>> |
The react Node returned from the function is rendered instead of the default ellipsis node |
selectedIndex |
number |
Index of the selected page |
사용 지침
- 페이지가 나뉜 콘텐츠를 탐색할 때 사용해요
- 명확한 페이지 표시를 제공해요
- 전체 페이지 수 표시를 고려해요
- 적절한 페이지 제한을 사용해요
콘텐츠 지침
- 명확한 페이지 라벨을 사용해요
- 의미 있는 탐색 텍스트를 제공해요
- 일관된 페이지네이션 용어를 사용해요
- 페이지 맥락 정보를 고려해요
접근성 지침
- 명확한 페이지 탐색 라벨을 제공해요
- 페이지네이션에 적절한 ARIA 라벨을 사용해요
- 키보드 탐색을 지원하도록 해요
- 페이지 변경을 스크린 리더에 알려요