@washingtonpost/wpds-pagination-dots
TypeScript icon, indicating that this package has built-in type declarations

1.24.0 • Public • Published

PaginationDots

Pagination dots show progress over a range of items (such as a carousel of images). Mandatory props are amount (the total amount of dots) and index (the 1-indexed position of the currently active dot). Optional prop is unitName, which describes the type of item the dots represent (such as page or image). When unitName is specified, the aria-valuetext will read "[unitName] x of y", where x and y are numbers (More on aria-valuetext here).

The PaginationDots component is meant to be controlled by another component, such as a Carousel which sets/updates amount and index to represent the items being traversed.

The parent element is meant to have a position: relative or position: absolute in order for the dots to attach to the element.

import { PaginationDots } from "@washingtonpost/wpds-ui-kit";

function Component() {
  return <PaginationDots amount={5} index={1} unitName="Page" />;
}

Readme

Keywords

none

Package Sidebar

Install

npm i @washingtonpost/wpds-pagination-dots

Weekly Downloads

1,744

Version

1.24.0

License

MIT

Unpacked Size

34.7 kB

Total Files

11

Last publish

Collaborators

  • tam.steph
  • wp-aberg
  • ebgranger
  • artmsilva