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[]}GRID_SHORTCUTS
Section titled “GRID_SHORTCUTS”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>Helpers
Section titled “Helpers”| Export | Role |
|---|---|
useIsMac() |
Platform flag for Mod key labels |
formatShortcutKey |
Token → display string (Mod → ⌘ / Ctrl) |
Wiring shortcuts UI
Section titled “Wiring shortcuts UI”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.
Related table config
Section titled “Related table config”Filter operators, sort icons, and feature detection live in Niko Table: