Skip to main content
rule

tailwind-css-nextjs-guide-cursorrules-prompt-file — Cursor rule

A Cursor instruction file for Next.js apps with Tailwind CSS and DaisyUI. It enforces strict TypeScript, Biome linting, and web3 conventions.

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/tailwind-css-nextjs-guide-cursorrules-prompt-file.mdc
Open on GitHub

What tailwind-css-nextjs-guide-cursorrules-prompt-file does

This rule guides Cursor when generating frontend code with Tailwind CSS utility classes and DaisyUI components. It targets the Next.js Pages router, directing the agent to write dynamic routes as [id].tsx and fetch data through getServerSideProps or getStaticProps. Custom CSS is discouraged unless strictly necessary.

The configuration mandates strict: true in tsconfig.json and bans any in favor of unknown with runtime checks. It also adopts Biome for formatting, requiring a pre-commit hook setup. Alongside UI rules, the prompt includes guidelines for Cairo smart contracts and Starknet React hooks. If your repository does not use Biome, the pre-commit checks will fail.

What it helps with

  • enforce Tailwind CSS and DaisyUI component styling
  • standardize dynamic data fetching in Next.js Pages router
  • replace any types with unknown and runtime checks
  • configure Biome code checks as a pre-commit step

Example prompts for the agent

  • Create a responsive user profile card using DaisyUI and Tailwind CSS.
  • Build a dynamic route [id].tsx fetching data with getServerSideProps.
  • Write a Starknet React hook to manage transaction state.

How to install tailwind-css-nextjs-guide-cursorrules-prompt-file

Manually: put the files in place

.cursor/rules/tailwind-css-nextjs-guide-cursorrules-prompt-file.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about tailwind-css-nextjs-guide-cursorrules-prompt-file

How do I install tailwind-css-nextjs-guide-cursorrules-prompt-file in Cursor?

Add the rule content to .cursor/rules/tailwind-css-nextjs-guide-cursorrules-prompt-file.mdc in your repository root.

Which linter does this rule require?

It requires Biome for linting, import sorting, and code formatting, configured in biome.json.

Does this rule cover smart contract development?

Yes, it includes explicit instructions for writing Cairo contracts and handling Starknet React connections.

Source text

tailwind-css-nextjs-guide-cursorrules-prompt-file.mdc · CC0-1.0
---
description: "Cursor rules for Tailwind CSS development with Next.js integration."
globs: **/*
alwaysApply: false
---
Prompt Generation Rules:

- Analyze the component requirements thoroughly
- Include specific DaisyUI component suggestions
- Specify desired Tailwind CSS classes for styling
- Mention any required TypeScript types or interfaces
- Include instructions for responsive design
- Suggest appropriate Next.js features if applicable
- Specify any necessary state management or hooks
- Include accessibility considerations
- Mention any required icons or assets
- Suggest error handling and loading states
- Include instructions for animations or transitions if needed
- Specify any required API integrations or data fetching
- Mention performance optimization techniques if applicable
- Include instructions for testing the component
- Suggest documentation requirements for the component

General Component Creation Guidelines:

- Prioritize reusability and modularity
- Ensure consistent naming conventions
- Follow React best practices and patterns
- Implement proper prop validation
- Consider internationalization requirements
- Optimize for SEO when applicable
- Ensure compatibility with different browsers and devices

General Rules:

- Enable strict TypeScript (strict: true in tsconfig.json)
- Avoid 'any', prefer 'unknown' with runtime checks
- Explicitly type function inputs and outputs
- Use advanced TypeScript features (type guards, mapped types, conditional types)
- Organize project structure: components, pages, hooks, utils, styles, contracts, services
- Separate concerns: presentational components, business logic, side effects
- Use Biome for code formatting and linting
- Configure Biome as a pre-commit hook

Next.js Rules:

- Use dynamic routes with bracket notation ([id].tsx)
- Validate and sanitize route parameters
- Prefer flat, descriptive routes
- Use getServerSideProps for dynamic data, getStaticProps/getStaticPaths for static
- Implement Incremental Static Regeneration (ISR) where appropriate
- Use next/image for optimized images
- Configure image layout, priority, sizes, and srcSet attributes

TypeScript Rules:

- Enable all strict mode options in tsconfig.json
- Explicitly type all variables, parameters, and return values
- Use utility types, mapped types, and conditional types
- Prefer 'interface' for extendable object shapes
- Use 'type' for unions, intersections, and primitive compositions
- Document complex types with JSDoc
- Avoid ambiguous union types, use discriminated unions when necessary

TailwindCSS and DaisyUI Rules:

- Use TailwindCSS utility classes for styling
- Avoid custom CSS unless absolutely necessary
- Maintain consistent order of utility classes
- Use Tailwind's responsive variants for adaptive designs
- Leverage DaisyUI components for rapid development
- Customize DaisyUI components only when necessary
- Define and use design tokens in tailwind.config.js

Starknet React Rules:

- Centralize blockchain connection management
- Implement automatic reconnection and error handling
- Use React hooks for transaction status management
- Provide clear UI feedback for blockchain interactions
- Implement comprehensive error handling for blockchain operations

Cairo Rules:

- Design modular and maintainable contract structures
- Optimize for gas efficiency
- Minimize state changes and storage access
- Document all contracts and functions thoroughly
- Explain complex logic and implementation choices

Development Process:

- Conduct thorough code reviews via Pull Requests
- Include clear PR descriptions with context and screenshots
- Implement comprehensive automated testing (unit, integration, e2e)
- Prioritize meaningful tests over high coverage numbers
- Use Conventional Commits for commit messages (feat:, fix:, docs:, chore:)
- Make small, incremental commits for easier review and debugging

Biome Rules:

- Use Biome for code formatting and linting
- Configure Biome as a pre-commit hook
- Follow Biome's recommended rules
- Customize Biome configuration in biome.json as needed
- Ensure consistent code style across the project
- Run Biome checks before committing changes
- Address all Biome warnings and errors promptly
- Use Biome's organize imports feature to maintain clean import statements
- Leverage Biome's advanced linting capabilities for TypeScript
- Integrate Biome into the CI/CD pipeline for automated checks
- Keep Biome updated to the latest stable version
- Use Biome's ignore patterns to exclude specific files or directories when necessary

© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set234

The whole set →
tanstack-query-v5-cursorrules-prompt-file A Cursor rule that tells the agent how to write TanStack Query v5 code: query keys, mutations, optimistic updates, Suspense and prefetching. ★ 41,024repo stars tailwind Guides Cursor on Tailwind CSS standards and mobile-first component styling. Triggers automatically when editing styles, JSX, TSX, or config files. ★ 41,024repo stars tailwind-shadcn-ui-integration-cursorrules-prompt- This Cursor rule guides Tailwind and shadcn/ui work, asking the assistant to outline a plan before writing readable TypeScript and Next.js code. ★ 41,024repo stars tailwind-react-firebase-cursorrules-prompt-file A Cursor rule that sets conventions for a mobile-first web app built with Tailwind, React and Firebase. ★ 41,024repo stars swiftui-guidelines-cursorrules-prompt-file This rule guides Cursor through SwiftUI architecture, concurrency, UI composition, and testing. Add it when you want those conventions reflected in code suggestions. ★ 41,024repo stars sveltekit-typescript-guide-cursorrules-prompt-file A Cursor rule that points the agent at Svelte 5, SvelteKit and TypeScript: project structure, runes, state handling. ★ 41,024repo stars sveltekit-tailwindcss-typescript-cursorrules-promp Defines project conventions for SvelteKit 2, Tailwind CSS, and TypeScript in Cursor. It keeps code consistent by enforcing typed components and proper directory structure. ★ 41,024repo stars sveltekit-restful-api-tailwind-css-cursorrules-pro This rule gives Cursor project guidance for SvelteKit, REST APIs, Tailwind CSS, testing, and file management. Use it to keep those practices in view while working on a project. ★ 41,024repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor