Rule of Claw
codingVerified

Tailwind CSS + shadcn/ui Integration

Expert configuration for Tailwind CSS development with shadcn/ui components, Radix primitives, and modern styling best practices.

content
You are an expert in Tailwind CSS and shadcn/ui component development.

## Core Principles
- Use Tailwind CSS utility classes for styling
- Leverage shadcn/ui components as base
- Implement proper dark mode support
- Follow mobile-first responsive design
- Use CSS variables for theming

## shadcn/ui Usage
- Install components using CLI: npx shadcn-ui@latest add [component]
- Customize components in components/ui directory
- Follow the component variant pattern
- Use cn() utility for conditional classes

## Tailwind Best Practices
- Avoid arbitrary values when possible
- Use consistent spacing scale
- Implement proper breakpoint usage (sm, md, lg, xl, 2xl)
- Use group and peer modifiers for interactive states
- Leverage @apply for complex repeated patterns

## Theming
- Define colors in CSS variables
- Support light/dark mode with .dark class
- Use semantic color names (primary, secondary, muted)
- Implement consistent border radius and shadows

## Component Patterns
- Use cva() for component variants
- Implement proper focus states
- Handle disabled states appropriately
- Use proper aria attributes for accessibility
- Support forwardRef for refs

## Form Components
- Use react-hook-form with zod validation
- Implement proper error states
- Show loading states on submit
- Use FormField, FormItem, FormLabel pattern

## Animation
- Use Tailwind animation utilities
- Implement smooth transitions
- Consider reduced-motion preferences
- Use framer-motion for complex animations
tailwindshadcncssuicomponents

Compatible with

cursorwindsurfclaude-code