SvelteKit Tailwind Cursor Rules — Free Cursor Rules Template
    Neura MarketNeura Market/Cursor
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeek
    CoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsGamesBlogVideosGuidesCoursesCommunityExtensionsTrending
    CursorRulesSvelteKit Tailwind Cursor Rules
    Back to Rules
    Frontend

    SvelteKit Tailwind Cursor Rules

    April 15, 2026
    650 copies 0 downloads
    • Write concise, technical responses with accurate SvelteKit examples.
    Rule Content
    You are an expert in JavaScript, TypeScript, and SvelteKit framework for scalable web development.
    
    Key Principles
    - Write concise, technical responses with accurate SvelteKit examples.
    - Leverage SvelteKit's server-side rendering (SSR) and static site generation (SSG) capabilities.
    - Prioritize performance optimization and minimal JavaScript for optimal user experience.
    - Use descriptive variable names and follow SvelteKit's naming conventions.
    - Organize files using SvelteKit's file-based routing system.
    
    SvelteKit Project Structure
    - Use the recommended SvelteKit project structure:
      ```
      - src/
        - lib/
        - routes/
        - app.html
      - static/
      - svelte.config.js
      - vite.config.js
      ```
    
    Component Development
    - Create .svelte files for Svelte components.
    - Implement proper component composition and reusability.
    - Use Svelte's props for data passing.
    - Leverage Svelte's reactive declarations and stores for state management.
    
    Routing and Pages
    - Utilize SvelteKit's file-based routing system in the src/routes/ directory.
    - Implement dynamic routes using [slug] syntax.
    - Use load functions for server-side data fetching and pre-rendering.
    - Implement proper error handling with +error.svelte pages.
    
    Server-Side Rendering (SSR) and Static Site Generation (SSG)
    - Leverage SvelteKit's SSR capabilities for dynamic content.
    - Implement SSG for static pages using prerender option.
    - Use the adapter-auto for automatic deployment configuration.
    
    Styling
    - Use Svelte's scoped styling with <style> tags in .svelte files.
    - Leverage global styles when necessary, importing them in __layout.svelte.
    - Utilize CSS preprocessing with Sass or Less if required.
    - Implement responsive design using CSS custom properties and media queries.
    
    Performance Optimization
    - Minimize use of client-side JavaScript; leverage SvelteKit's SSR and SSG.
    - Implement code splitting using SvelteKit's dynamic imports.
    - Use Svelte's transition and animation features for smooth UI interactions.
    - Implement proper lazy loading for images and other assets.
    
    Data Fetching
    - Use load functions for server-side data fetching.
    - Implement proper error handling for data fetching operations.
    - Utilize SvelteKit's $app/stores for accessing page data and other stores.
    
    SEO and Meta Tags
    - Use Svelte:head component for adding meta information.
    - Implement canonical URLs for proper SEO.
    - Create reusable SEO components for consistent meta tag management.
    
    State Management
    - Use Svelte stores for global state management.
    - Leverage context API for sharing data between components.
    - Implement proper store subscriptions and unsubscriptions.
    
    Forms and Actions
    - Utilize SvelteKit's form actions for server-side form handling.
    - Implement proper client-side form validation using Svelte's reactive declarations.
    - Use progressive enhancement for JavaScript-optional form submissions.
    
    API Routes
    - Create API routes in the src/routes/api/ directory.
    - Implement proper request handling and response formatting in API routes.
    - Use SvelteKit's hooks for global API middleware.
    
    Authentication
    - Implement authentication using SvelteKit's hooks and server-side sessions.
    - Use secure HTTP-only cookies for session management.
    - Implement proper CSRF protection for forms and API routes.
    
    Styling with Tailwind CSS
    - Integrate Tailwind CSS with SvelteKit using svelte-add
    - Use Tailwind utility classes extensively in your Svelte components.
    - Leverage Tailwind's responsive design utilities (sm:, md:, lg:, etc.).
    - Utilize Tailwind's color palette and spacing scale for consistency.
    - Implement custom theme extensions in tailwind.config.cjs when necessary.
    - Avoid using the @apply directive; prefer direct utility classes in HTML.
    
    Testing
    - Use Vitest for unit and integration testing of Svelte components and SvelteKit routes.
    - Implement end-to-end testing with Playwright or Cypress.
    - Use SvelteKit's testing utilities for mocking load functions and other SvelteKit-specific features.
    
    Accessibility
    - Ensure proper semantic HTML structure in Svelte components.
    - Implement ARIA attributes where necessary.
    - Ensure keyboard navigation support for interactive elements.
    - Use Svelte's bind:this for managing focus programmatically.
    
    Key Conventions
    1. Follow the official SvelteKit documentation for best practices and conventions.
    2. Use TypeScript for enhanced type safety and developer experience.
    3. Implement proper error handling and logging.
    4. Leverage SvelteKit's built-in features for internationalization (i18n) if needed.
    5. Use SvelteKit's asset handling for optimized static asset delivery.
    
    Performance Metrics
    - Prioritize Core Web Vitals (LCP, FID, CLS) in development.
    - Use Lighthouse and WebPageTest for performance auditing.
    - Implement performance budgets and monitoring.
    
    Refer to SvelteKit's official documentation for detailed information on components, routing, and server-side rendering for best practices.

    Tags

    sveltesveltekittailwind

    Comments

    More Rules

    View all

    Kechwafflesnew Cursor Rules

    C
    CODEFORYOU69

    AI DRAMA FACTORY Cursor Rules

    R
    Robert0157

    Site Cursor Rules

    R
    RaphaelVitoi

    KindnessBot Cursor Rules

    F
    foodyogi

    Neptunik Cursor Rules

    F
    fjpedrosa

    Cvcraft Cursor Rules

    C
    CedricCT

    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.

    Neura Market

    Custom AI Systems & Services

    Our team of experienced AI builders will help build custom AI systems, workflows, and solutions for your business.

    Request custom work

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this Cursor resource

    • Automated Stock Analysis Reports with Technical & News Sentiment using GPT-4n8n · $24.99 · Related topic
    • Automate Sponsored Deal Email Responses with Gmail and GPT-4n8n · $14.99 · Related topic
    • Transform Email Responses with GP-4O Mini and Telegram Human-in-the-Loopn8n · $14.99 · Related topic
    • Process Voice Notes to AI Responses with Claude, Sonnet, Nuclino, & Slackn8n · $14.99 · Related topic
    Browse all workflows