Page:
Pagination
Pages
Accordion
AccordionItem
Alert
Avatar
Badge
BarChart
Button
ButtonGroup
Card
Changelog
ChartLegend
Checkbox
CodeEditor
Collapsible
Combobox
CommandPalette
ContextMenu
CopyButton
DatePicker
Dialog
DonutChart
Drawer
Field
FileInput
FileList
Forms
Gauge
Getting started
Heatmap
Home
Image
InlineEdit
Input
Kbd
Label
LineChart
Menu
MultiSelect
NumberInput
Overlays
Pagination
Popover
Progress
RadioGroup
Scroller
Select
Separator
ShareBar
Sheet
Skeleton
Slider
Sparkline
Spinner
StatCard
Switch
Table
Tabs
TagsInput
Textarea
Theming
Toaster
Toggle
Tooltip
Tree
No results
4
Pagination
L4stIdi0t edited this page 2026-10-06 12:08:41 +02:00
Table of contents
Pagination
Page navigation.
A <nav> of real buttons, with aria-current="page" on the one you are on — the part that is usually missing, and the only way a screen reader user knows where they are in the list. The window of page numbers always shows the first and last page plus a span around the current one, with an ellipsis where numbers were dropped.
Navigation · two-way: bind:page
<script lang="ts">
import { Pagination } from '@l4st/driftwood';
</script>
| Light | Dark |
|---|---|
![]() |
![]() |
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
page bind: |
number |
1 |
1-based. |
count required |
number |
— | Total pages. Below 2 the component renders nothing. |
siblings |
number |
1 |
Page numbers either side of the current one. |
class |
string |
— | Merged with the component's own classes, last — so yours win. |
aria-label |
string |
'Pagination' |
Names the <nav>, so a screen reader can skip past it. |
previousLabel |
string |
'Previous page' |
Accessible name of the ← button. Localise here. |
nextLabel |
string |
'Next page' |
Accessible name of the → button. Localise here. |
pageLabel |
(page: number) => string |
(n: number) => `Page ${n}` |
Accessible name for a page button, e.g. n => Page ${n}. Localise here. |
onPageChange |
(page: number) => void |
— | Fires with the new page, after clamping to 1…count. |
Example
The markup behind the screenshot above, lifted from src/routes/shots/ — so it
compiles, and it is exactly what produced the image.
<Pagination page={6} count={20} />
Navigation · Tree · Tabs · CommandPalette · Kbd
driftwood
Layout
Actions
Forms
- Field
- Input
- FileInput
- FileList
- Textarea
- CodeEditor
- Combobox
- RadioGroup
- NumberInput
- InlineEdit
- Label
- Select
- MultiSelect
- DatePicker
- TagsInput
- Checkbox
- Switch
- Slider
Feedback
Charts
Overlays
Navigation
Generated from the source by pnpm wiki · repository · v0.24.0

