SuperAPI AI Directory

shadcn

General & other

View repository

Updated 10-16 04:54

About this skill

shadcn/ui Community Best Practices

Current best-practices guide for shadcn/ui applications. Before applying primitive-specific guidance, inspect whether the checked-in components use Radix UI or Base UI; current shadcn supports both (Base UI is the default for new projects) and their composition APIs differ. Component installs and upgrades go through the current CLI (v4), which resolves namespaced registries.

When to Apply

Reference these guidelines when:

  • Writing new shadcn/ui components or composing primitives
  • Implementing forms with React Hook Form and Zod validation
  • Building data tables or handling large dataset displays
  • Customizing themes or adding dark mode support
  • Reviewing code for accessibility compliance

Rule Categories by Priority

Priority Category Impact Prefix
1 Component Architecture CRITICAL arch-
2 Accessibility Preservation CRITICAL ally-
3 Styling & Theming HIGH style-
4 Form Patterns HIGH form-
5 Data Display MEDIUM-HIGH data-
6 Component Composition MEDIUM comp-
7 Performance Optimization MEDIUM perf-
8 State Management LOW-MEDIUM state-

Quick Reference

1. Component Architecture (CRITICAL)

2. Accessibility Preservation (CRITICAL)

3. Styling & Theming (HIGH)

4. Form Patterns (HIGH)

5. Data Display (MEDIUM-HIGH)

6. Component Composition (MEDIUM)

7. Performance Optimization (MEDIUM)

8. State Management (LOW-MEDIUM)

How to Use

Run in the project root first:

npx -y @pymodel/react-frontend-skills detect  # installed vs. targeted versions

Read references/<rule-id>.md for each rule above that matches the task: why it matters, then incorrect vs. correct code.