Plasmic Cursor Rules — Cursor Rules | Neura Market
    Neura MarketNeura Market/Cursor
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeek
    CoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsBlogVideosGuidesCoursesCommunityExtensionsTrendingGenerate
    CursorRulesPlasmic Cursor Rules
    Back to Rules
    Frontend

    Plasmic Cursor Rules

    April 15, 2026
    0 copies 0 downloads

    This is a set of rules that outlines the best practices and architecture principles to create Plasmic-compatible code:

    Rule Content
    This is a set of rules that outlines the best practices and architecture principles to create Plasmic-compatible code:
    
    Plasmic-Specific Guidelines
    
    - Build reusable components for Plasmic Studio, not pages
    - Pass as much UI work as possible to Plasmic Studio
    - For repeatable components, use string/number props over slots
    - Use slot components for images when possible; apply default styles with ".element image" selectors
    - Use DataProvider only when exposing data to Plasmic Studio is necessary
    - Use the Plasmic state feature if you need to listen to or propagate changes
    
    Component Registration
    
    - Register all components in plasmic-host.tsx
    - Import components at the top of the file
    - Use registerComponent with proper configuration (see Plasmic docs)
    - Set appropriate name and displayName
    - Use importPath with @/ prefix only in codegen mode (if loader library is absent)
    - Provide default values for required props
    - Add descriptive comments for each prop
    - By default, registerComponent includes a className prop for root styles (do not add it explicitly)
    
    Props Configuration
    
    - Use type: "class" for all className props (never "string")
    - For eventHandler props, include argTypes: []
    - Use these types for props:
      - "string" for text
      - "number" for numbers
      - "boolean" for toggles
      - "imageUrl" for images
      - "array" for collections
      - "eventHandler" for callbacks
      - "slot" for customizable content
      - "class" for styles
    
    Naming Conventions
    
    - PascalCase: Components, Types, Interfaces
    - kebab-case: directories, file names (e.g., auth-wizard, user-profile.tsx)
    - camelCase: variables, functions, methods, hooks, props
    - UPPERCASE: environment variables, constants
    - Prefix event handlers with 'handle' (e.g., handleClick)
    - Prefix booleans with verbs (e.g., isLoading, hasError)
    - Prefix custom hooks with 'use' (e.g., useAuth)
    - For style props, use suffix ClassName (e.g., titleClassName)
    - For event handlers, use prefix on (e.g., onClick)
    
    Styling Guidelines
    
    - Use CSS modules (e.g., ComponentName.module.css)
    - Design mobile-first and responsively
    - Include hover states and transitions for interactive elements
    - Add fallback styles for missing content (e.g., no-image state)
    - Ensure color contrast accessibility
    - Maintain consistent spacing
    - Define CSS variables for theme colors and spacing
    - Use Plasmic's registerToken/tokens for CSS variable integration
    - Pass className for root element to allow Studio style customization
    - Use classnames feature to allow Studio to override/modify child styles
    - Allow initial CSS in UI components for Studio users to extend
    
    Data & State Handling
    
    - Use DataProvider only when exposing data to Studio is needed (in case if user would need to render something using the data, like a repeatable component, or if the component itself is created to fetch the data)
    - Transform data inside the component as needed
    - Define states in registration when needed, with correct valueProps/onChangeProps/variableType
    - When using data sources (like fetching data from remote database) - use data fetching components, look up supabase example repository to see how it's done
    
    Common Mistakes to Avoid
    
    - Do not create pages; only reusable components
    - Do not use type: "string" for className props (use "class")
    - Do not use slots for repeatable components populated from data
    - Do not forget argTypes: [] for eventHandler props
    - Do not forget providesData: true when using DataProvider
    - Do not add className prop again in registration
    - Do not use app router features without confirming project structure
    - Use "dynamic" clause to load registered components that rely on heavy front-end dependencies (like google maps, etc.)

    Tags

    plasmiclow-codereactnext.js

    Comments

    More Rules

    View all
    Web Development

    Next.js 15 + TypeScript Cursor Rules

    Comprehensive .cursorrules file for Next.js 15 App Router projects with TypeScript, enforcing server components by default, proper use of "use client" directive, and App Router conventions.

    C
    Community
    Backend Development

    Python FastAPI Best Practices Rules

    Cursor rules for Python FastAPI projects enforcing async patterns, Pydantic v2 models, dependency injection, and proper error handling.

    C
    Community
    Frontend Development

    React + TypeScript Component Rules

    Rules for consistent React component development with TypeScript interfaces, proper hook patterns, and component composition.

    C
    Community
    AI/ML

    Cursor Agent Mode Configuration

    Rules optimizing Cursor Agent mode behavior including multi-file editing context, session management, and autonomous task completion patterns.

    C
    Cursor Team
    Frontend Development

    Tailwind CSS + shadcn/ui Rules

    Cursor rules for projects using Tailwind CSS with shadcn/ui component library, enforcing consistent utility class usage and component patterns.

    C
    Community
    Backend Development

    Go Backend Service Rules

    Rules for Go backend services enforcing idiomatic Go patterns, proper error handling, and clean architecture conventions.

    C
    Community

    Stay up to date

    Get the latest Cursor prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for Cursor and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.