Skip to content
Niko Table

Niko Grid Config

Keyboard shortcut data and helpers for the Niko Grid help dialog.

Use this to show users the grid’s keyboard shortcuts. The grid/config/ folder holds a readable list that mirrors the <DataGrid> keydown handler. Connect it to DataGridShortcutsButton or GridShortcutsList with onRequestShortcuts.

interface GridShortcut {
/** Key tokens. "Mod" renders as ⌘ on macOS, Ctrl elsewhere. */
keys: string[]
description: string
}
interface GridShortcutGroup {
category: string
shortcuts: GridShortcut[]
}

A grouped list (Navigation, Selection, Editing, Clipboard, and more). Update it when the <DataGrid> handler changes.

import { GRID_SHORTCUTS } from "@/components/niko-table/grid/config/grid-shortcuts"
import { GridShortcutsList } from "@/components/niko-table/grid/components/grid-shortcuts-dialog"
<dialog>
<GridShortcutsList groups={GRID_SHORTCUTS} />
</dialog>
Export Role
useIsMac() Platform flag for Mod key labels
formatShortcutKey Token → display string (Mod → ⌘ / Ctrl)
const [open, setOpen] = React.useState(false)
<DataGrid grid={grid} onRequestShortcuts={() => setOpen(true)}>
…
</DataGrid>
<DataGridShortcutsButton /> {/* or open your own dialog on `open` */}

If you do not set onRequestShortcuts, ? types into the cell as normal.

Filter operators, sort icons, and feature detection live in Niko Table: