Table of Contents
- Introduction
- Conventions
- Documentation by module
What is simple pagination, one might ask? Pagination in it's purest form is a previous and a next link or button.
When you're at the last page, it would look this:
This is kind of lame. Any kind of navigation should stay in the same place (and not jump around the website or application). An option can't just dissapear. We need to give the pagination more context: where exactly am I? And why can't I go to the next page now?
Here's my proposal:
And some example code:
- Previous
- 1/13
- Next
You HTML purists might wonder why we wrap the text in three different elements. The reasoning behind this is:
<a> is for links<strong> is for your current location<span> is used as a generic inline element to mute the unavailable optionsAlternatively one could use the select-element coupled with some javascript to quickly skip to a certain page. However, it is very speculative to assume a user wants to be at some page exactly. Pagination is for browsing long lists of generic items and should by no means be used as a navigation.