You are an expert in TypeScript, Node.js, Next.js App Router, React, Shadcn UI, Radix UI, Framer Motion and Tailwind.
Code Style and Structure
- Write concise, technical TypeScript code with accurate examples.
- Use functional and declarative programming patterns; avoid classes.
- Prefer iteration and modularization over code duplication.
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
- Structure files: exported component, subcomponents, helpers, static content, types.
Naming Conventions
- Use lowercase with dashes for directories (e.g., components/auth-wizard).
- Favor named exports for components.
- Use PascalCase for component names.
TypeScript Usage
- Use TypeScript for all code; prefer interfaces over types.
- Avoid enums; use maps instead.
- Use functional components with TypeScript interfaces.
Syntax and Formatting
- Use the "function" keyword for pure functions.
- Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
- Use declarative JSX.
UI and Styling
- Use Shadcn UI, Radix,Framer Motion and Tailwind for components and styling.
- Implement responsive design with Tailwind CSS; use a mobile-first approach.
- Use lucide icons for icons
- when using framer motion in server components, import it like this `import * as motion from "framer-motion/client"`
- when using framer motion in client components, import it like this `import * as motion from "framer-motion"`
- use images most relevant images needed for the components from the following website https://images.unsplash.com/
example : ```https://images.unsplash.com/photo-1577705998148-6da4f3963bc8?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1287&q=80```
Performance Optimization
- Use dynamic loading for non-critical components.
- Optimize images: use WebP format, include size data, implement lazy loading.
Key Conventions
- Use 'nuqs' for URL search parameter state management.
- Optimize Web Vitals (LCP, CLS, FID).
- Limit 'use client':
- Favor server components and Next.js SSR.
- Use only for Web API access in small components.
- Avoid for data fetching or state management.
- when using client components, always wrap the component with 'use client' at the top of the file
- when using states in a component, always wrap that component with 'use client' at the top of the file
Follow Next.js docs for Data Fetching, Rendering, and Routing.
Follow Framer Motion docs for animations.
Follow Shadcn UI docs for components.
Follow Tailwind CSS docs for styling.
Always use the latest stable versions of all technologies.
- always provide code explanation along with the code in steps
- if code needs to be implemented in any file or folder structure, always provide the exact folder structure and the file name where the code needs to be implemented into.
css
html
javascript
next.js
radix-ui
react
shadcn/ui
tailwindcss
+1 more
First Time Repository
A Laundry Website
TypeScript
Languages:
CSS: 7.8KB
HTML: 23.7KB
JavaScript: 0.8KB
TypeScript: 61.1KB
Created: 10/9/2024
Updated: 10/14/2024
All Repositories (1)
A Laundry Website