function / @typed/ui

Grid.moveActiveId

Maps grid keys to a cell id: horizontal movement stays in-row, vertical movement stays in-column, and Ctrl+Home/End reaches grid endpoints.

Learn this UI primitive →

Package version
1.0.0-beta.13
Category
Spatial navigation
Since
1.0.0
Member of
Grid

Import

import { Grid } from "@typed/ui";

Access Grid.moveActiveId through the imported Grid export. Its declaration below describes the member.

This public exposure is a re-export. Its import path is supported; declaration documentation is shared with the other public exposures below.

Signatures

export declare function moveActiveId(items: readonly Collection.Item<CellPosition>[], activeId: string | null, event: Pick<KeyboardEvent, "key" | "ctrlKey">): string | undefined;

Examples

import * as Grid from "@typed/ui/Grid";

const nextId = Grid.moveActiveId([{ id: "a", value: { rowId: "r1", columnIndex: 1 } }], "a", { key: "ArrowRight", ctrlKey: false });

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source