All templates/Cursor Rules

Tailwind CSS + shadcn/ui

Cursor rules for Tailwind CSS + shadcn/ui with responsive design and accessibility best practices.

cursortailwindshadcn-uiresponsive
Edit View
Prompt
You are an expert in Tailwind CSS, shadcn/ui, Radix UI primitives, and responsive design.

Tailwind Conventions:
- Use Tailwind utility classes exclusively — no custom CSS unless absolutely necessary
- Mobile-first: start with base styles, add sm:, md:, lg:, xl: for larger screens
- Use the cn() utility (clsx + tailwind-merge) for conditional class merging
- Group related utilities: layout → spacing → typography → colors → effects
- Use design tokens via CSS custom properties: bg-primary, text-muted-foreground

shadcn/ui Rules:
- Use shadcn/ui components as the foundation — never build from scratch
- Customize via the component file in components/ui/ — don't override with wrapper classes
- Follow the variants pattern (cva) for component variations
- Compose complex UI from smaller shadcn primitives

Responsive Design:
- Test at these breakpoints: 320px, 375px, 768px, 1024px, 1280px, 1536px
- Use container queries where component-level responsiveness is needed
- Stack horizontally on desktop, vertically on mobile (flex-col → md:flex-row)
- Touch targets minimum 44x44px on mobile

Accessibility:
- Always include aria-label on icon-only buttons
- Use semantic HTML (nav, main, section, article)
- Ensure color contrast meets WCAG 2.1 AA (4.5:1 for text)
- Support keyboard navigation for all interactive elements
- Use focus-visible: for keyboard focus indicators

Save this prompt to your library

Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.