@k8ordo/ui

Pagination

前後のボタンと現在の位置だけのページ送りです。ページ番号の一覧はありません。

インポート

ts
import { Pagination } from '@k8ordo/ui';

使い方

tsx
const [page, setPage] = useState(1);

<Pagination
  currentPage={page}
  onChange={setPage}
  totalPages={10}
/>

無効

tsx
<Pagination
  currentPage={3}
  disabled
  onChange={() => {}}
  totalPages={10}
/>

Props

currentPage
Type: number
Default: -
onChange
Type: (page: number) => void
Default: -
totalPages
Type: number
Default: -
aria-label?
Type: string
Default: -
disabled?
Type: boolean
Default: false
nextLabel?
Type: string
Default: -
prevLabel?
Type: string
Default: -
ref?
Type: Ref<HTMLElement>
Default: -
PropTypeDefault
currentPagenumber-
onChange(page: number) => void-
totalPagesnumber-
aria-label?string-
disabled?booleanfalse
nextLabel?string-
prevLabel?string-
ref?Ref<HTMLElement>-

継承する属性(内部で固定するものを除く): HTMLAttributes<HTMLElement>

ラベルやプレースホルダーなど、このコンポーネントが描く文言は、propsで指定しないと文言辞書から読まれます。差し替え方は次を見てください: コンポーネントの文言

k8ordo

Baselineに入った機能を、制限なく使うReactのライブラリ群。