Home/Appearance & Platform/Keyboard Navigation
Appearance & Platform

Keyboard Navigation

Click a cell and drive the whole grid from the keyboard — arrows move a focused cell, Enter edits it, Space selects the row, Tab never traps you. On by default, nothing to configure.

ID
Name
Department
City
Role
Salary
1
Amira Hassan
Engineering
Cairo
Lead
$42,000
2
Omar Nabil
Design
Remote
Senior
$43,700
3
Lena Rashid
Sales
London
Mid
$45,400
4
Yusuf Zaki
Marketing
Tokyo
Junior
$47,100
5
Nadia Farouk
Support
Austin
Manager
$48,800
6
Karim Salem
Finance
Berlin
Lead
$50,500
7
Sara Fahmy
Engineering
Cairo
Senior
$52,200
8
Hana Khaled
Design
Remote
Mid
$53,900
9
Tarek Aziz
Sales
London
Junior
$55,600
10
Maya Mansour
Marketing
Tokyo
Manager
$57,300
11
Amira Hassan
Support
Austin
Lead
$59,000
12
Omar Nabil
Finance
Berlin
Senior
$60,700
13
Lena Rashid
Engineering
Cairo
Mid
$62,400
14
Yusuf Zaki
Design
Remote
Junior
$64,100
15
Nadia Farouk
Sales
London
Manager
$65,800
16
Karim Salem
Marketing
Tokyo
Lead
$67,500
17
Sara Fahmy
Support
Austin
Senior
$69,200
18
Hana Khaled
Finance
Berlin
Mid
$70,900
19
Tarek Aziz
Engineering
Cairo
Junior
$72,600
20
Maya Mansour
Design
Remote
Manager
$74,300
21
Amira Hassan
Sales
London
Lead
$76,000
22
Omar Nabil
Marketing
Tokyo
Senior
$77,700
23
Lena Rashid
Support
Austin
Mid
$79,400
24
Yusuf Zaki
Finance
Berlin
Junior
$81,100
25
Nadia Farouk
Engineering
Cairo
Manager
$82,800
26
Karim Salem
Design
Remote
Lead
$84,500
50 / 200 records

Click a cell, then drive the grid from the keyboard

Keyboard navigation is on by default — no config, no callbacks. Click any cell (or Tab into the grid) and a focus ring appears. From there the keyboard does everything the mouse can:

KeysWhat they do
↑ ↓ ← →Move one cell. The grid scrolls on its own to keep the focused cell visible.
Tab / Shift+TabNext / previous cell, wrapping across rows. At the very last cell, focus leaves the grid — no keyboard trap.
Home / EndFirst / last column of the row.
Ctrl+Home / Ctrl+EndFirst / last cell of the grid.
PgUp / PgDnOne viewport up / down. With pagination, crossing the last row moves to the next page.
EnterOpen the inline editor on an editable cell. Committing returns focus to the cell.
EscapeClose the editor without saving — focus returns to the cell.
SpaceSelect / deselect the focused row (when row selection is on).

Focus survives everything

The focused cell is remembered by row identity, not screen position. Scroll a thousand rows away and back — the ring is still on the same cell. Edit a value, sort a column, or receive a live update — focus stays where you left it.

Editing flows through the keyboard

Enter opens the editor, Enter again commits, Escape cancels — and in every case the cell keeps the focus, so you can keep moving with the arrows. Tab inside an editor commits and moves to the next cell, Excel-style. Try it on the Name, City, or Salary columns above.

Grouped rows are part of the path

With row grouping active, the arrows stop on group headers as whole-row positions — Enter or Space expands and collapses the group, then ↓ walks into its rows. One continuous path, no separate "modes".

Opting out

Set keyboardNav: false to disable the model entirely, or restyle / remove the ring with the --gc-cell-focus-outline CSS variables — no JavaScript required.

readonly config: GridConfig<Person> = {
  keyboardNav: false,        // no focus model at all
};

/* or keep the model, restyle the ring: */
gridcraft { --gc-cell-focus-outline: #16a34a; --gc-cell-focus-outline-width: 1px; }

In right-to-left layouts (dir: 'rtl') the horizontal arrows follow the visual direction — → always moves toward the right of the screen.

Keyboard navigation API

PropertyTypeDefaultDescription
config.keyboardNavbooleantrueThe focused-cell model + all key handling. Set false to disable entirely.
(cellFocusChange)CellFocusEvent<T>—Emits on every focus move: { row, column, rowId, colKey } — row/column are null on group rows and unloaded rows.
focusCell(rowId, colKey)void—Focus a cell programmatically (scrolls it into view) — e.g. restoring focus after a dialog.
--gc-cell-focus-outline / -width / -offsetCSS varstheme accent, 2px, -2pxThe focus ring. Keyboard-only (:focus-visible) — mouse clicks never paint it.