Pagination

Easily create a nice looking pagination to navigate through pages.

FrankenstyleKit (aka Franken UI 3.0) is now available. Support for the current version will gradually wind down. It will continue to work, but using the latest version is recommended for new projects so you can benefit from future updates and enhancements.

Table of contents

Usage

The Pagination component consists of button-like styled links, that are aligned side by side in a horizontal list.

ClassDescription
.uk-pgnAdd this class to a <ul> element to define the Pagination component. Use <a> elements as pagination items within the list.
.uk-activeAdd this class to a list item to apply an active state and use a <span> instead of an <a> element.
.uk-disabledAdd this class to a list item to apply a disabled state and use a <span> instead of an <a> element.

To add an icon, just add the data-uk-pgn-previous or data-uk-pgn-next attribute to a <span> element inside a pagination item.

Style modifiers

There are several style modifiers available. Just add one of the following classes to apply a different look.

ClassDescription
.uk-pgn-defaultAdds the default style.
.uk-pgn-primaryAdds a primary style.
.uk-pgn-secondaryAdds a secondary style.
.uk-pgn-destructiveAdds a destructive style.
.uk-pgn-ghostAdds a ghost style.

Size modifiers

There are several size modifiers available. Just add one of the following classes to make the pagination smaller or larger.

ClassDescription
.uk-pgn-xsApplies extra small size.
.uk-pgn-smApplies small size.
.uk-pgn-mdApplies medium size.
.uk-pgn-lgApplies large size.

Alignment

The Pagination component utilizes flexbox, so navigations can easily be aligned with Flex utility classes from Tailwind CSS.

Accessibility

The previous/next pagination adheres to the button pattern and automatically sets the appropriate WAI-ARIA roles, states and properties.

  • The prev/next pagination items have the button role and the aria-label property.

Internationalization

The Pagination component uses the following translation strings. Learn more about translating components.

KeyDefaultDescription
labelNext/Previous pagearia-label attribute.
Customize

Customize your Franken UI experience.