@cloudflare/component-pagination
TypeScript icon, indicating that this package has built-in type declarations

11.0.5 • Public • Published

@cloudflare/component-pagination

Cloudflare Pagination Component

Installation

Installation with yarn is recommended

$ yarn add @cloudflare/component-pagination

Usage

import React from 'react';
import { createComponent } from '@cloudflare/style-container';
import { Pagination } from '../../src';

const Margin = createComponent(({ theme }) => ({
  margin: theme.space[2]
}));

const onPrevClick = () => console.log('prev click!');
const onNextClick = () => console.log('next click!');

class PaginationComponent extends React.Component {
  render() {
    return (
      <div>
        <Margin>
          <Pagination
            start={1}
            end={15}
            total={60}
            onPrevClick={onPrevClick}
            onNextClick={onNextClick}
          />
        </Margin>
        <Margin>
          <Pagination
            start={45}
            end={60}
            total={60}
            onPrevClick={onPrevClick}
            onNextClick={onNextClick}
          />
        </Margin>
        <Margin>
          <Pagination
            start={45}
            end={60}
            onPrevClick={onPrevClick}
            onNextClick={onNextClick}
          />
        </Margin>
        <Margin>
          <Pagination
            start={1}
            end={15}
            total={60}
            onPrevClick={onPrevClick}
            onNextClick={onNextClick}
            loading
          />
        </Margin>
        <Margin>
          <Pagination
            start={1}
            end={15}
            total={15}
            disablePreviousButton={true}
            disableNextButton={true}
            onPrevClick={onPrevClick}
            onNextClick={onNextClick}
          />
        </Margin>
      </div>
    );
  }
}

export default PaginationComponent;

Readme

Keywords

none

Package Sidebar

Install

npm i @cloudflare/component-pagination

Weekly Downloads

6,338

Version

11.0.5

License

BSD-3-Clause

Unpacked Size

226 kB

Total Files

25

Last publish

Collaborators

  • rexscaria
  • dcruz_cf
  • xuranwang
  • jculvey
  • sejoker
  • cf-radar
  • cf-ci-write
  • segments-write
  • thibmeu
  • xortive
  • gurjinder
  • cf-ci2
  • lvalenta
  • worenga
  • chiminator
  • third774
  • jasnell
  • terinjokes
  • celso
  • jsteinberger
  • geelen
  • gregbrimble
  • asapzacy
  • g4brym
  • wrangler-publisher
  • sgoodhew_cf
  • cf-media-manager
  • dash_service_account
  • lbarthonet
  • jacobbednarz
  • lerwincf
  • simonabadoiu
  • cms1919
  • mgirouard-cf
  • musa-cf
  • vaishakpdinesh
  • ichernetsky-cf
  • jseba_cf
  • gabivlj-cf
  • ganders-cloudflare
  • nsharma-cf
  • mikenomitch
  • tlefebvre_cf
  • nafeezcf
  • eduardo-vargas