shadcn

Review and refactor Radix-based React components for shadcn/ui architecture, accessibility, and styling.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/remiconnesson/insights-garden --skill shadcn-remiconnesson
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shadcn
Source: https://github.com/remiconnesson/insights-garden/tree/main/.agents/skills/shadcn
Command: npx skills add https://github.com/remiconnesson/insights-garden --skill shadcn-remiconnesson

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

This Skill helps teams build and refactor shadcn/ui components without breaking accessibility, composition, theming, or form behavior. It reduces common implementation mistakes that lead to fragile Radix-based UI code, inconsistent styling, and poor keyboard or screen reader support.

Core Features & Use Cases

  • Component Architecture Guidance: Keeps Radix primitives structured correctly, with safe trigger composition, forward refs, and reusable variant patterns.
  • Accessibility Preservation: Protects focus management, keyboard navigation, ARIA attributes, labels, contrast, and screen reader support.
  • Styling and Form Best Practices: Encourages cn-based class merging, CSS-variable theming, React Hook Form integration, Zod validation, and responsive UI patterns.
  • Use Case: When adding a dialog, form, combobox, sidebar, or data table, this Skill helps you choose the right shadcn/ui pattern and avoid regressions.

Quick Start

Use this skill to review or generate a shadcn/ui component and apply the relevant architecture, accessibility, theming, and form rules.

Frequently Asked Questions about shadcn

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent accessibility regressions when building shadcn/ui components?

Prevent accessibility regressions in shadcn/ui by preserving Radix primitive focus management, keyboard navigation, and ARIA attributes during component composition. This ensures screen reader support and keyboard interactions remain intact when customizing triggers or layouts.

What is the correct way to apply custom themes to shadcn/ui components?

The correct way to apply custom themes to shadcn/ui components is using CSS-variable theming combined with the cn utility for class merging. This approach maintains styling consistency and prevents Tailwind class conflicts across component variants.

How do I integrate React Hook Form with shadcn/ui form components?

Integrate React Hook Form with shadcn/ui by connecting form primitives to React Hook Form's register and control functions, pairing it with Zod validation to enforce schema rules. This combination maintains accessible error states and controlled inputs.

Does shadcn/ui require TypeScript path aliases and a components.json setup?

Yes, shadcn/ui requires TypeScript path aliases and a components.json setup to resolve component imports correctly. Configuring these files ensures the CLI generates components in the correct directories and maintains the expected architectural structure.

Why does forwardRef break when refactoring Radix-based shadcn/ui components?

forwardRef breaks in Radix-based shadcn/ui components when the ref prop is not properly passed through the component hierarchy to the underlying Radix primitive. Maintaining forwardRef usage ensures parent components can access the DOM node for focus management and measurement.

What's the best way to manage class merging for shadcn/ui variant patterns?

The best way to manage class merging for shadcn/ui variant patterns is using the cn utility to reconcile Tailwind CSS classes. This prevents duplicate or conflicting styles when applying conditional variants and responsive UI patterns to components.