Pagination
import { Pagination, useFitRows } from "@arcadia/ui";| Turn | Duration |
|---|---|
| Read the brief | 1s |
| Find the draft | 1s |
| Check the references | 10s |
Pagination
page- number
- Default:
0 - The current page, from 0. Out of range reads as the last page. Left out with a
morefoot. pageSize- number
- Default:
25 - Rows per page. Left out with a
morefoot. total- number
- Default:
0 - Every row there is, across pages. Left out with a
morefoot: a cursor list never knows its total. onPageChange- (page: number) => void
- Turns the page. Left out with a
morefoot. pageSizes- readonly number[]
- Default:
[10, 25, 50] - The row-count choices; with
onPageSizeChange, a "Rows" picker appears. onPageSizeChange- (size: number) => void
noun- readonly [one: string, many: string]
- Default:
["row", "rows"] - What a row is, singular and plural, for the range ("1 to 10 of 351 turns"). Default:
row. label- string
- Default:
"Pages" - Names the navigation landmark. Default: "Pages". A
morefoot draws none. showPage- boolean
- Default:
true - "Page 2 of 6" between the arrows. False for a list that fits its page: the range already says where you are, and the footer keeps to one line beside a meter.
more- { shown: number; onMore: () => void; hasMore?: boolean; loading?: boolean; label?: string; error?: ReactNode }
- A cursor list, which reads one page at a time and never knows how many there are: the foot says how many rows are showing ("40 cards") and offers the one quiet control that reads more, in place of the pages.
shownis how many are showing andonMorereads the next page;hasMorefalse takes the control away at the end,loadingputs its spinner in the label's place,labelnames it ("Show more cards", the noun's plural), anderrorshows the product's own line and Try again where it stood. Leavepage,pageSize,totalandonPageChangeout. rootStyle- PaginationStyle
- Pagination has no knobs of its own: place it with
rootStyle.
Rest props go to HTMLAttributes<HTMLElement>.