Page Up and Page Down
What You'll Learn
You'll learn how to implement Page Up and Page Down key support to let users quickly navigate through long lists and scrollable regions in larger chunks.
The Big Picture
Imagine scrolling through a hundred-item list one arrow key press at a time—tedious, right? Page Up and Page Down keys let users jump through content in meaningful chunks, typically moving several items at once rather than one at a time.
Think of it like an elevator versus stairs. Arrow keys are the stairs—one step at a time. Page Up/Down is the elevator—jumping multiple floors in one go.
When to Implement This Pattern
Page Up and Page Down are most useful in:
- Long lists (menus, autocomplete results, file explorers)
- Scrollable regions (textboxes, content viewers)
- Grid layouts (jumping down/up multiple rows)
- Any context where arrow navigation exists but the content is extensive
How It Works
When using roving tabindex or custom keyboard navigation, you listen for the PageUp and PageDown key codes and move focus by a larger increment—typically 5-10 items instead of just 1.
For a vertical list with arrow navigation already implemented:
- Page Down: Move focus 10 items forward (or to the last item if fewer remain)
- Page Up: Move focus 10 items backward (or to the first item)
- Home: Jump to first item (already covered)
- End: Jump to last item (already covered)
The exact "chunk size" depends on your UI—consider what's visible in the viewport or what feels natural for your content length.
Why This Matters
Users with motor disabilities or those who rely solely on keyboards benefit enormously from efficient navigation. Making them traverse 100 items one-by-one creates unnecessary friction.
Key Takeaway: Page Up and Page Down keys provide chunk-based navigation for long content, letting keyboard users move efficiently through lists and scrollable regions without exhausting repetition.