Grid Field

Graph-paper lines (or a dot grid) behind a section, with a few cells that slowly light up and fade, like squares being filled in on a worksheet. It says "careful, measured work" without saying anything.

decorativeclientuiv1.0.0

Preview

Grid Field — live rendereffects-gridfield--default ↗

Rendered from the story the storybook (a11y) CI gate runs axe against — the preview can't show something that hasn't been verified.

Install

Two equivalent paths — the URL works in any shadcn-CLI setup; the alias works once you've registered @interlace in your components.json.

Via shadcn URL
npx shadcn@latest add https://ds.interlace.tools/r/grid-field.json
With the @interlace alias
npx shadcn@latest add @interlace/grid-field

History

This component is at v1.0.0. The version is stamped as a banner into the file the install writes, so the copy in your tree says which one you have — compare it with the number above before deciding whether to re-run the install.

Unreleased1 entry

  • Breakingmajor

    The last borrowed motion components are replaced with Interlace's own, written from scratch. Content that moves now renders in full on the server and is announced once; decoration is a layer you drop inside any component, so a button stays a Button and a card stays a Card: - CountUp: a number that counts to its value when it scrolls into view. The server renders the final figure, the box never shifts, and format takes any Intl.NumberFormat options. - Scroller: a looping row of items. Each item is announced and tabbed to once, a visible Pause button sits beside it, and under reduced motion it becomes a plain scrollable row. - StaggerList: a real ul or ol whose items arrive one by one, once. Focus shows an item at once. - SheenText: a few words painted with a slow travelling gradient, on text-grade tokens, with a forced-colours fallback. - Sheen: a band of light that crosses its parent. Put it inside a Button; it sits under the label. - EdgeGlow: a light that runs around the edge of a Card or any positioned element. - GridField: graph-paper lines or a dot grid, with a few seeded (or chosen) cells that light up and fade, and with interactive, the cell under the pointer. Button is now relative isolate and Card is relative, so Sheen and EdgeGlow work inside them with no extra classes.

    Migration

    The @interlace/ui/magicui/* entry points and their registry items are removed. Replace NumberTicker with CountUp (value, from, duration, and format for decimals or compact notation), Marquee with Scroller (direction, duration, gap, pauseOnHover; children become list items), AnimatedList with StaggerList (it reveals once and does not loop), AnimatedGradientText with SheenText (from, to, duration), ShimmerButton with a Button that contains a <Sheen />, BorderBeam with EdgeGlow (from, to, width, length, duration), AnimatedGridPattern, InteractiveGridPattern, GridPattern and DotPattern with GridField (mark="lines" | "dots", cell, lit or cells, seed, fade, interactive; GridPattern's squares become cells), and Particles with Starfield.

Import

2 named exports — pull the parts you need.

Public API
import { GridField, gridFieldCells } from '@/components/ui/effects/grid-field';

API reference

Parsed from the type declarations in the source — the same file the install writes into your tree, so this table can't drift from the component you get.

GridFieldProps

Also accepts every <div> attribute.

PropTypeDescription
mark'lines' | 'dots'Draw the grid as lines or as dots at the crossings. @default 'lines'
cellnumberSize of one cell, in pixels. @default 40
litnumberHow many cells light up, placed by `seed`. Ignored when `cells` is set. @default 14
cellsReadonlyArray<readonly [number, number]>The cells to light, as `[column, row]` pairs, instead of seeded ones.
seednumberChanges which cells light up. @default 5
lineColorstringColour of the lines or dots. @default 'var(--border)'
litColorstringColour of the lit cells. @default 'var(--primary)'
intensitynumberStrongest a lit cell gets, 0 to 1. @default 0.18
fadekeyof typeof FADEWhere the field dissolves. @default 'radial'
animatedbooleanSet false to hold the cells still even when motion is allowed. @default true
interactivebooleanLight the cell under the pointer as well. @default false

Accessibility

Every story for this component is rendered headlessly and checked with axe-core (wcag2aa, wcag22aa, best-practice, ACT) on every PR. That gate has no continue-on-error, so what ships has zero known violations.

What follows is what static analysis can see. Axe cannot press a key and never sees an overlay open, so the operable-without-a-mouse claim lives in Behavior instead, where the keyboard path is replayed step by step.

Focus + keyboard behaviour
Native element semantics — no interaction layer to get wrong.
Focus ring (WCAG 2.2 SC 2.4.13)
Not focusable — no focus indicator required.
Reduced motion
Animation is gated on prefers-reduced-motion.
ARIA in the source
None — semantics come from the element or the Base UI primitive rather than hand-written ARIA.

Examples

5 more states from the same story file.

R-rule compliance

Every primitive in @interlace/ui models to the portable 26-rule floor enforced by the componentApi ESLint preset. The cells below pin exactly where each rule applies in this file.

RuleConceptWhere
R4Extends native el`div` props (minus aria-hidden)
R6data-slot per partgrid-field / -cell
R7cn + ...rest`cn(…, className)` + `{...props}`
R8Enums, not booleans`mark`, `fade`
R19Tokens only`--border`, `--primary` defaults
R25Client componentthe breathing runs in the browser
R26A11yhidden, inert to the pointer

Dependencies

Base UI primitive
Native / no Base UI dependency
Lucide icons
none
NPM dependencies
none

Source

The full implementation — components/ui/effects/grid-field.tsx once installed.

257 lines · TypeScript
'use client';

import * as React from 'react';

// @interlace/grid-field v1.0.0 — Interlace design system.
// Docs, props and live preview: https://ds.interlace.tools/c/grid-field
// What changed since: https://ds.interlace.tools/c/grid-field#history
// Generated banner — keep it, the upgrade diff reads this version.

/**
 * @interlace/ui — GridField
 *
 * Graph-paper lines (or a dot grid) behind a section, with a few cells that
 * slowly light up and fade, like squares being filled in on a worksheet. It
 * says "careful, measured work" without saying anything.
 *
 * ## Drawn the same everywhere
 *
 * The grid, lines or dots, is one SVG `<pattern>`, so a full-bleed field
 * costs one element, not hundreds. The lit cells come from a seeded

…237 more lines…

Registry JSON

The raw registry record — what the shadcn CLI fetches.