What problem does it solve?
This Skill helps developers ensure their React components built with shadcn/ui follow best practices for CVA patterns, composition, accessibility, and data-slot usage, leading to more robust and maintainable code.
Core Features & Use Cases
- CVA Pattern Enforcement: Reviews the correct usage of
class-variance-authority for defining component variants and styles.
- Composition Best Practices: Checks for proper implementation of patterns like
asChild with @radix-ui/react-slot and context-based composition.
- Accessibility Audits: Verifies that interactive elements and form components adhere to accessibility standards (focus states, ARIA attributes, etc.).
- Data-Slot Usage: Ensures
data-slot attributes are used for targetable component parts, enabling easier styling and DOM manipulation.
- Use Case: When reviewing a new custom button component that uses shadcn/ui, this skill will flag if
className is incorrectly passed to CVA, if asChild is used without Slot, or if focus states are missing.
Quick Start
Use the shadcn-code-review skill to review the attached React component file 'src/components/ui/button.tsx'.