Skip to content

Config

Keyboard shortcut metadata and helpers for the Data Grid help UI.

The grid/config/ directory holds discoverable shortcut metadata: the human-readable mirror of <DataGrid>’s keydown handler. Wire it to DataGridShortcutsButton / GridShortcutsList via onRequestShortcuts.

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

Grouped reference list (Navigation, Selection, Editing, Clipboard, …). Keep it in sync when the container’s 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` */}

When onRequestShortcuts is unset, ? types normally into the cell.

Filter operators, sort icons, and feature detection live on the table side: