Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Keyboard Focus Grid Features Block for React

A six-cell feature grid for a keyboard-first notes app: one focus ring glides between cells with the arrow keys, and Enter or a tap writes the cell's detail into a strip under the grid.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A keyboard-driven feature grid for React with Base UI. Six cells share hairlines inside one rounded frame, each with an icon, a name, a sentence and its shortcut as key caps. One focus ring sits over the grid and glides from cell to cell as the arrow keys move focus; Enter, Space or a tap selects a cell and writes its longer description into a strip under the grid. The header carries the keys to try. The page's rails and top rule come from the Guides spine. It's built from Kbd and Guides, with a CSS transition for the ring and your theme's tokens for every colour. For notes apps, editors and any product whose pitch is that it never needs the mouse.

FAQ

How do I change the cells?

Edit FEATURES at the top of the file: each entry has a name, a short text, a longer detail, an icon and the keys shown as key caps. The grid is three columns by two rows; with another count, change the ring's height and width classes to match the columns and rows.

Which keys does it answer to?

The four arrow keys move focus one cell and stop at the edges; Enter and Space select the focused cell, as they do on any button. Only one cell is a tab stop (the others have tabindex="-1"), so Tab passes through the grid in one stop and the arrow keys do the rest. In a right-to-left layout the left and right arrows swap, so they follow what you see.

How does the ring move?

It is one element, laid over the grid, whose position comes from the index of the focused cell through CSS variables, with a CSS transition on translate. It is solid while focus is inside the grid and a faint outline at rest, so a tap on a phone still shows where you are. With reduced motion the transition is off and the ring jumps.

Why does the strip under the grid never change height?

Every cell's detail is laid out in the strip at once, in one grid cell, with all but the visible one invisible. The strip is as tall as the longest, so selecting a cell never moves what is below it. The strip is a polite live region, so a screen reader hears the selected feature's name and detail.

How does it work on a phone?

The grid becomes two columns by three rows and the ring uses its own phone positions, so it still lands on the right cell. A tap selects a cell and moves the ring there, and the one-line descriptions drop out of the cells to keep them short; the strip still shows the full detail.

Does it follow my theme?

Yes. Nothing is a fixed colour: the frame, the cells, the key caps and the ring use your theme's border, muted and foreground tokens, in light and in dark.

  • Pro

    A shortcut cheat sheet for a shortcut trainer: two groups of four shortcuts in one framed card, where pressing a shortcut while the card is focused lights its row.

  • Pro

    A live command menu for a workflow launcher: a search field that filters nine actions in three groups, with a preview pane that shows what the highlighted action will do.

  • Pro

    A dock of eight tool tiles that grow with their distance from the pointer, under a detail card that follows the active tile, built on tabs so the arrow keys and a tap work too.

  • Pro

    Six ring-inset preference cells for a team-settings app, each holding one working control: a switch, a slider, a toggle group, a select, a checkbox and a segmented control.

  • Pro

    An inspection lens over a dense latency table: a magnified copy clipped to a circle follows the pointer and a readout names the cell under it, with arrow keys to move it and a tap-to-pin readout on a phone.

  • Pro

    A board of six vertical sliders for an alert-tuning tool, each with a level meter and a readout, and a composite readout of pages a week and incidents caught worked out from the six settings.