Nearby lessons
16 of 39π BS5 Pagination
π What Is Bootstrap 5 Pagination?
Pagination lets users move between pages (e.g. search results). Use .pagination on a <ul>, .page-item on each <li>, and .page-link on the <a> inside. Wrap in <nav> with aria-label for accessibility.
π Basic Pagination (.pagination, .page-item, .page-link)
.pagination β wrapper on the list. .page-item β each page or arrow. .page-link β the clickable link inside. Use .active on the current pageβs .page-item. Use .disabled on the .page-item for Previous/Next when not available.
β¬ οΈβ‘οΈ Disabled and Active States (.active, .disabled)
.active β highlights the current page. .disabled β grays out and prevents click (e.g. βPreviousβ on page 1). Add tabindex="-1" to disabled links for keyboard users.
π Pagination Sizes (.pagination-lg, .pagination-sm)
.pagination-lg β larger pagination. .pagination-sm β smaller. Add to the <ul class="pagination">.
β Pagination Best Practices
- Use <nav> and aria-label so screen readers know itβs page navigation.
- Disable Previous/Next on first/last page with
.disabledandtabindex="-1". - Mark current page with
.activeon the corresponding.page-item.
π§ Test Your Knowledge
3 QuestionsProgress: 0 / 3
Keep Going!BS5 List Groups