Skip to main content

Starwind UI v3.0 beta is now available! Read the migration guide

Pagination

Installation

Framework Availability

Astro Available React Available

Pagination is available for Astro and React.

Usage

General Notes

The basic pagination component includes previous/next buttons and numbered pages.

Tip

Use the isActive prop on <PaginationLink> to highlight the current page.

Sizes

Show pagination examples using small and large button sizes.

API Reference

Styled Component API

These props are added or materially changed by the installed Astro styled component. Standard HTML attributes remain available through the inherited interfaces noted below. Follow the Primitive and Runtime links for lower-level behavior props.

Inherits Button props. Omits `as`, `ref`, and `variant`.

Contains the following additional props:

Prop Type Default Toggle details
isActive boolean
Description
Applies the active visual state.
Classification
Wrapper prop

Pagination Ellipsis

Inherits span attributes.

Contains the following additional props:

Prop Type Default Toggle details
size "icon-sm" | "icon" | "icon-lg" "icon"
Description
Selects the component's visual size.
Classification
Styled variant

Changelog

v3.1.0

  • Added contract-generated Astro and React implementations while preserving the component’s existing public API and styling.

v3.0.4

  • Refactor tailwind variants functions into separate variants.ts file

v3.0.2

  • add size prop to PaginationEllipsis
  • Adjust PaginationNext and PaginationPrevious to use button variant props for sizes

v3.0.1

  • Add named slot “icon” to PaginationEllipsis to enable easy icon swapping, and a default slot for the sr-only label
  • Add named slot “icon” to PaginationNext and Pagination Previous to enable easy icon swapping

v3.0.0

  • Now requires the starwind button component installed to make use of the button variants for PaginationLink

v2.1.0

  • Add data-slot attribute to enable global styling updates

v2.0.1

  • Add eslint comments to disable “no-explicit-any” when using Astro special syntax to require a child element

v2.0.0

  • tailwind-variants now implemented. This uses tailwind-merge under the hood to merge Tailwind classes without style conflicts.
  • Removed radius prop now that classes like “rounded-full” can be passed to the components to override, taking advantage of tailwind-variants