CSS Pagination
Category: NavigationPagination is not packaged as a component because different systems use pagination in various ways. Designing pagination with native HTML and CSS allows flexible combination of pagination elements for...
Simple Usage
Wrap with _pagination
class. Use:
selected
attribute for current pagerep=total
for total pages countrep=prev
for previous pagerep=next
for next pagerep=first
for first pagerep=last
for last page
By default centered. Combine with:
align=start
for left alignmentalign=end
for right alignment
- Output
- HTML
Multiple Variations
Navigation icons can be:
- Plain text
- Special characters
- Font icons
- Output
- HTML
Using Form Fields
Pagination often includes page jump and items per page selection, which may require select and input fields.
Default pagination height (32px) is smaller than form fields (40px), so use CSS variables to align them.
We typically use the framework's custom form fields for items per page and page jump.
Sizes
Default pagination height is 32px. Set size with:
size=sm
: 24px heightsize=md
: 32px height (default)size=lg
: 40px height (matches default form field height)
- Output
- HTML
Button Group Style
Standard structure includes:
rep=main
: Contains page numbers and all navigation buttonsrep=pages
: Contains only page numbers
Add type=group
attribute to implement button group style.
Minimalist Style
Use type=plain
attribute for simplest minimalist style. This removes borders from navigation buttons and page numbers.
Special Characters
When using special characters in pagination, add _char
class to increase their font size since default size is small.