enes

Exported components

  • PipsPager

PipsPager AI

A PipsPager is a row of dots that shows the current page in a paginated set, such as a FlipView, and lets users move to another page.

Usage

<script>
  import { PipsPager } from 'fluentui-svelte';
  let index = $state(0);
</script>

<PipsPager aria-label="Pages" numberOfPages={5} bind:index />

With a FlipView

Bind the same index to a FlipView and the PipsPager to keep them in sync.

Landscape 1Landscape 2Landscape 3Landscape 4Landscape 5

Orientation

orientation lays the pips out horizontally (default) or vertically.

horizontal
vertical

Previous and next buttons

buttonVisibility shows the buttons always (visible) or on hover and focus (hover). They hide on the first and last page, unless wrap loops past the ends.

buttonVisibility="visible"
buttonVisibility="hover"
wrap

Many pages

maxVisiblePips caps the visible pips; the rest scroll into view as the selection or the focus moves.

Chapter 1 of 20

Page numbers

showNumbers replaces the dot with its page number on hover, on focus and briefly after a selection.

showNumbers

Keyboard and accessibility

Tab reaches the selected pip. The arrow keys, Home and End move the focus; Enter and Space select. The selected pip has aria-current="page". Name the pager with aria-label and localize previousLabel, nextLabel and formatPage.

Component Props

NameTypeDefaultDescription
index bindablenumber0The index of the selected page.
numberOfPagesnumberThe number of pages.
maxVisiblePipsnumber5The number of pips shown at once; the rest scroll into view.
orientation'horizontal' | 'vertical''horizontal'The direction the pips are laid out in.
buttonVisibility'hidden' | 'visible' | 'hover''hidden'When the previous and next buttons are shown: never, always or on hover and focus.
wrapbooleanWhether the buttons and arrow keys wrap from the last page to the first and back.
showNumbersbooleanWhether the page number replaces the dot on hover, on focus and briefly after a selection.
previousLabelstring'Previous page'Accessible name of the previous button.
nextLabelstring'Next page'Accessible name of the next button.
formatPage(page: number) => string(page) => `Page ${page}`Returns the accessible name of each pip from its page number.
onIndexChange(index: number) => voidCalled when the selected page changes.
ref bindableHTMLDivElement | nullThe root element.
Element Attributes (div)

Support Fluent UI Svelte

The library is built by one person in their free time. If it helps your work, consider sponsoring it.