Skip to content

shadcn/ui Grid Notes

Copy-in React components built on Base UI or Radix UI and Tailwind CSS v4, plus an official MCP server that searches and installs from any namespaced registry.

Grid NotesVersion 4.x CLIUI librariesChecked 2026-11-06
Setup & agent config

Install and prerequisites

What your agent should install or configure before writing code with this pack.
Terminal
npx shadcn@latest add button dialog
Packages:shadcnclass-variance-authoritylucide-react

A components.json file at the project root (npx shadcn@latest init) and Tailwind CSS v4 (@import "tailwindcss";).

Framework setup

Production-ready wiring for React 19, Next.js App Router and Tailwind CSS v4.

Configuring namespaced community registries in components.json

Built-in registries in ui.shadcn.com/r/registries.json (@magicui, @aceternity, @react-bits, @coss) work out of the box; add custom URL templates under registries.

components.json
{
  "$schema": "https://ui.shadcn.com/schema.json",
  "style": "base-nova",
  "rsc": true,
  "tsx": true,
  "aliases": {
    "components": "@/components",
    "utils": "@/lib/utils",
    "ui": "@/components/ui"
  },
  "registries": {
    "@fancy": "https://fancycomponents.dev/r/{name}.json"
  }
}

Merging classes in buttonVariants and custom links

cva only concatenates strings; always wrap cva(...) output in cn() so caller classes override default borders or spacing cleanly.

components/ui/button.tsx
export function buttonVariants(props?: VariantProps<typeof variants> & { className?: string }) {
  const { className, ...rest } = props ?? {};
  return cn(variants(rest), className);
}

Gotchas for agents

Real-world traps — version mismatches, licence boundaries, main-thread stalls and CSS layer rules — that trip AI agents up.
  1. Tailwind v4 outline-none breaks focus-visible:outline-*

    In Tailwind CSS v4, .outline-none sets --tw-outline-style: none, which .focus-visible:outline-2 uses to draw its line. Never combine outline-none with focus-visible:outline-* on the same element (combining outline-none with focus-visible:ring-3 is safe because ring uses box-shadow).

  2. Base UI vs Radix UI composition (render vs asChild)

    Check style in components.json: Base UI styles (base-*, using @base-ui/react) compose links via render={<Link href="/path" />} instead of Radix's asChild prop.

  3. Destructive badge contrast in light mode

    Default destructive solid badge text often falls below 4.5:1 AA contrast on light backgrounds. Prefer an outline badge with border-destructive/60 and an icon so status is also not conveyed by colour alone (WCAG 1.4.1).

Accessibility and reduced motion

How to keep animations and interactive components accessible across keyboard, screen readers and prefers-reduced-motion.

Reduced motion

Use motion-reduce:transition-none and motion-reduce:animate-none alongside tw-animate-css utility classes on popovers, dialogs and accordions.

Keyboard and screen readers

When placing a RadioGroup inside a <fieldset>, pass the <legend id> to RadioGroup's aria-labelledby prop so screen readers announce the group label on entry.