Glin UI
Primitive / Moleculebeta

Highlight Grid

Hairline cell grid with one shared highlight that glides to the hovered, tapped or focused cell.

Edit on GitHub
  • 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

Install from
pnpm dlx @glinui/cli@latest add highlight-grid

Prefer 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

KeyAction
Arrow keysMove between cells (left and right reversed in RTL, up and down follow the real column count).
Home / EndFirst or last cell.
EnterFollows 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 transitions

API Reference

PropTypeRequiredDefaultDescription
cellsHighlightGridCell[]Yes-Cells. With href the body renders as a link.
columns1 | 2 | 3 | 4 | 5 | 6No3Columns from the lg breakpoint up. Narrow screens use 1 or 2.
cellRenderer(cell: HighlightGridCell, state: HighlightGridCellState) => React.ReactNodeNo-Custom cell body.
variantHighlightGridVariantNoambient (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/motion

Generated API Snapshot

Beta

Auto-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

PropTypeRequiredDefaultDescription
cellRenderer(cell: HighlightGridCell, state: HighlightGridCellState) => React.ReactNodeNo--
cellsHighlightGridCell[]Yes--
columns1 | 2 | 3 | 4 | 5 | 6No3Columns from the lg breakpoint up. Narrow screens use 1 or 2.
variantHighlightGridVariantNo-Highlight panel look. `glinr` is an accent wash with a soft border, `plain` a neutral wash, `glass` a blurred sheet.