PluginBench
Rule

react styled components

via PatrickJS/awesome-cursorrules

React development with Styled Components integration and best practices.

What is react styled components?

This rule guides React development using Styled Components for CSS-in-JS styling. It establishes conventions for functional components with hooks, theming with ThemeProvider, and a structured folder layout. Use it to maintain consistency when building styled React applications.

  • Enforces functional components with React hooks
  • Provides Styled Components best practices including macro imports and global theming
  • Defines folder structure for components, styles, and theme organization
  • Recommends naming conventions for styled components (e.g., StyledButton)
  • Guides TypeScript support and dynamic styling with props
  • Suggests using attrs method and css helper functions for advanced patterns

Applies to

File patterns this rule matches.

**/*
Rule definition (reference)

Source of truth, from the repository.

// React + Styled Components .cursorrules

// Prefer functional components with hooks

const preferFunctionalComponents = true;

// Styled Components best practices

const styledComponentsBestPractices = [ "Use the styled-components/macro for better debugging", "Implement a global theme using ThemeProvider", "Create reusable styled components", "Use props for dynamic styling", "Utilize CSS helper functions like css`` when needed", ];

// Folder structure

const folderStructure = src/ components/ styled/ styles/ theme.js globalStyles.js pages/ utils/;

// Additional instructions

const additionalInstructions = `

  1. Use proper naming conventions for styled components (e.g., StyledButton)
  2. Implement a consistent theming system
  3. Use CSS-in-JS for all styling needs
  4. Utilize styled-components' attrs method for frequently used props
  5. Implement proper TypeScript support for styled-components
  6. Use the css prop for conditional styling when appropriate
  7. Follow the styled-components documentation for best practices `;

Related rules

Zero-loading-spinner React SPA with TanStack Router v1 + TanStack Query v5 for type-safe URLs and cache-first data.

["src/routes/**/*" +3
41k
via PatrickJS/awesome-cursorrules

Zero-loading-spinner routing with TanStack Router v1 and Query v5 for type-safe React SPAs

**/*
41k
via PatrickJS/awesome-cursorrules

Expert guidance for React, TypeScript, Next.js 14, and Web3 stack development with Wagmi and Viem.

**/*
41k
via PatrickJS/awesome-cursorrules

Full-stack React, TypeScript, and Symfony development assistant with Docker expertise.

**/*
41k
via PatrickJS/awesome-cursorrules

React and TypeScript state management guidance for Zustand stores, selectors, middleware, persistence, and testing.

**/*.ts +1
41k
via PatrickJS/awesome-cursorrules

Write READMEs that convert readers in 3-5 seconds with landing-page structure and working code examples.

**/*
41k
via PatrickJS/awesome-cursorrules