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.
Install and prerequisites
npx shadcn@latest add button dialogshadcnclass-variance-authoritylucide-reactA components.json file at the project root (npx shadcn@latest init) and Tailwind CSS v4 (@import "tailwindcss";).
Framework setup
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.
{
"$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.
export function buttonVariants(props?: VariantProps<typeof variants> & { className?: string }) {
const { className, ...rest } = props ?? {};
return cn(variants(rest), className);
}Gotchas for agents
Tailwind v4 outline-none breaks focus-visible:outline-*
In Tailwind CSS v4,
.outline-nonesets--tw-outline-style: none, which.focus-visible:outline-2uses to draw its line. Never combineoutline-nonewithfocus-visible:outline-*on the same element (combiningoutline-nonewithfocus-visible:ring-3is safe becauseringusesbox-shadow).Base UI vs Radix UI composition (render vs asChild)
Check
styleincomponents.json: Base UI styles (base-*, using@base-ui/react) compose links viarender={<Link href="/path" />}instead of Radix'sasChildprop.Destructive badge contrast in light mode
Default
destructivesolid badge text often falls below 4.5:1 AA contrast on light backgrounds. Prefer anoutlinebadge withborder-destructive/60and an icon so status is also not conveyed by colour alone (WCAG 1.4.1).
Accessibility and 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.
More Grid Notes
- React BitsAnimated text effects, shaders, cursors and interactive backgrounds installed as source code in four variants (`-JS-CSS`, `-JS-TW`, `-TS-CSS`, `-TS-TW`).
- Magic UIOver 150 animated landing-page components — marquees, Bento grids, shimmer buttons, globes and device mocks — built with React, Tailwind CSS and Motion.
- Aceternity UIDramatic landing-page hero sections, 3D card perspectives, spotlights, beams and macbook scroll effects built with React 19, Tailwind CSS v4 and Motion.
- Motion PrimitivesComposable, minimal React motion building blocks — animated groups, text effects, morphing dialogs, docks and carousels — built on Motion and Tailwind CSS.
- coss uiOpen-source React components built on Base UI (`@base-ui/react`) and Tailwind CSS v4 (formerly Origin UI; `originui.com` redirects here).
- Fancy ComponentsExperimental, playful React components — letter swaps, variable-font hover effects, physics gravity, gooey SVG filters and image trails — built with Tailwind CSS and Motion.



