Highlight Grid
Hairline cell grid with one shared highlight that glides to the hovered, tapped or focused cell.
pnpm dlx @glinui/cli@latest add highlight-grid- SpeedShips with no runtime cost per cell.
- SafetyKeyboard and screen reader ready.
- DesignEvery surface comes from tokens.
- MotionRespects reduced motion everywhere.
- ThemesLight, dark and custom scopes.
- AccessibilityRoving focus and visible rings.
Installation
pnpm dlx @glinui/cli@latest add highlight-gridPrefer the package?
Usage
Our own design (clean-room, no upstream code). One highlight panel glides between hairline cells instead of every cell animating on its own.
The panel is measured against the grid with physical offsets, so mirrored RTL layouts work. A ResizeObserver keeps it aligned when the grid reflows.
Entering the grid from outside places the panel on the entry cell with no fly-in from a corner.
Variants
glinr accent wash, plain neutral wash and glass.
- SpeedShips with no runtime cost per cell.
- SafetyKeyboard and screen reader ready.
- DesignEvery surface comes from tokens.
- SpeedShips with no runtime cost per cell.
- SafetyKeyboard and screen reader ready.
- DesignEvery surface comes from tokens.
- SpeedShips with no runtime cost per cell.
- SafetyKeyboard and screen reader ready.
- DesignEvery surface comes from tokens.
<HighlightGrid variant="plain" cells={cells} />States
Link cells with an href, reachable with the keyboard.
<HighlightGrid columns={2} cells={cells.map((c) => ({ ...c, href: "#" + c.id }))} />In a layout
A features section under a heading.
Why teams switch
- SpeedShips with no runtime cost per cell.
- SafetyKeyboard and screen reader ready.
- DesignEvery surface comes from tokens.
- MotionRespects reduced motion everywhere.
- ThemesLight, dark and custom scopes.
- AccessibilityRoving focus and visible rings.
<section aria-labelledby="why"> <h3 id="why">Why teams switch</h3> <HighlightGrid columns={3} cells={cells} /></section>Accessibility
- A list of cells with a roving tabindex. Arrow keys, Home and End move focus and the highlight follows.
- The panel is aria-hidden and pointer-events-none, so cells and links stay clickable.
- Touch: tapping a cell moves the highlight and it stays until you tap elsewhere.
- The highlight is never the only indicator, keyboard focus also shows a ring.
Keyboard Interactions
| Key | Action |
|---|---|
| Arrow keys | Move between cells (left and right reversed in RTL, up and down follow the real column count). |
| Home / End | First or last cell. |
| Enter | Follows the link of a cell with href. |
ARIA Attributes
- `role="list"` with list items
- Decorative panel uses `aria-hidden`
Reduced Motion
The glide, resize and fade only run at motion level full. Otherwise the highlight jumps to the new cell.
Affected properties
panel transform, size and opacity transitionsAPI Reference
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
cells | HighlightGridCell[] | Yes | - | Cells. With href the body renders as a link. |
columns | 1 | 2 | 3 | 4 | 5 | 6 | No | 3 | Columns from the lg breakpoint up. Narrow screens use 1 or 2. |
cellRenderer | (cell: HighlightGridCell, state: HighlightGridCellState) => React.ReactNode | No | - | Custom cell body. |
variant | HighlightGridVariant | No | ambient (glinr) | Highlight look: glinr accent wash, plain neutral wash, glass blurred sheet. |
Source
Import directly from the package or browse the source on GitHub. Click any file to view it.
Import
import { HighlightGrid } from "@glinui/ui"Dependencies
@glinui/ui@glinui/motionGenerated API Snapshot
Beta
Generated API Snapshot
BetaAuto-extracted from TypeScript source in packages/ui/src/components/highlight-grid.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.
Generated: 2026-10-08T01:41:21.546Z · Full index: /docs/api-metadata
Primary Props Type
HighlightGridProps
HighlightGridProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
cellRenderer | (cell: HighlightGridCell, state: HighlightGridCellState) => React.ReactNode | No | - | - |
cells | HighlightGridCell[] | Yes | - | - |
columns | 1 | 2 | 3 | 4 | 5 | 6 | No | 3 | Columns from the lg breakpoint up. Narrow screens use 1 or 2. |
variant | HighlightGridVariant | No | - | Highlight panel look. `glinr` is an accent wash with a soft border, `plain` a neutral wash, `glass` a blurred sheet. |