How to add Pagination in Fluent UI Detaillist using react
Asked Answered
H

1

11

I have created the sample by using this link https://developer.microsoft.com/en-us/fluentui#/controls/web/detailslist

Now I want to add Pagination in the grid. Please let me know the steps.

Horse answered 14/9, 2020 at 8:50 Comment(0)
P
2

You can use import { Pagination } from '@uifabric/experiments';

  <Pagination
        selectedPageIndex={page}
        pageCount={pageCount}
        onPageChange={onPageChange}
        format
        firstPageIconProps={{ iconName: 'DoubleChevronLeft' }}
        previousPageIconProps={{ iconName: 'ChevronLeft' }}
        nextPageIconProps={{ iconName: 'ChevronRight' }}
        lastPageIconProps={{ iconName: 'DoubleChevronRight' }}
    />
Potsherd answered 25/11, 2020 at 10:4 Comment(2)
Except the path should be '@fluentui/react-experiments/lib/Pagination' and the package is named @fluentui/react-experimentsIndwell
Sadly, this doesn't work with v9 as the package is trying to use font icons for the buttons. It might be better to copy the source and reimplement it with your own icon buttons: github.com/microsoft/fluentui/tree/master/packages/…Indwell

© 2022 - 2024 — McMap. All rights reserved.