This document provides essential information for AI coding agents working on the Interactive Interfaces project.
Interactive Interfaces is a Next.js application showcasing interactive UI components built with React, TypeScript, TailwindCSS, and Framer Motion. The project demonstrates various animation and interaction patterns.
npm run devorbun run dev- Start development servernpm run buildorbun run build- Build for productionnpm run startorbun run start- Start production server
npm run lintorbun run lint- Run ESLintnpm run lint:fixorbun run lint:fix- Run ESLint with auto-fixnpm run formatorbun run format- Format code with Prettiernpm run format:checkorbun run format:check- Check Prettier formattingnpm run type-checkorbun run type-check- Run TypeScript type checking
Currently no test framework is configured. When adding tests:
- Use a framework like Jest or Vitest
- Test command:
npm run testorbun run test - Run single test:
npm run test -- <test-file>orbun run test -- <test-file>
app/ # Next.js App Router pages
components/ # Reusable React components
atoms/ # Small atomic components
utils/ # Utility functions
styles/ # Global styles
assets/ # Static assets
- Use absolute imports with
@/prefix (configured in tsconfig.json) - Group imports: React imports first, then third-party, then local imports
- Use named imports for clarity
- Example:
import * as React from "react"
import { motion } from "motion/react"
import Link from "next/link"
import classNames from "@/utils/classNames"
import { getMetadata } from "@/utils/metadata"- Components: PascalCase (e.g.,
JellyTags,SliderTabs) - Files: PascalCase for components, camelCase for utilities
- Functions: camelCase (e.g.,
toggleTag,getMetadata) - Interfaces: PascalCase with 'I' prefix (e.g.,
ITag,Props) - Types: PascalCase (e.g.,
MetadataArgs) - Variables: camelCase (e.g.,
isSelected,currentTags) - Constants: UPPER_SNAKE_CASE (e.g.,
BASE_URL)
- Use functional components with TypeScript
- Define props interfaces explicitly
- Use React.FC for component typing
- Add "use client" directive for client components
- Example:
"use client"
import * as React from "react"
interface Props {
children: React.ReactNode
}
const MyComponent: React.FC<Props> = ({ children }) => {
return <div>{children}</div>
}- Strict mode enabled (
strict: truein tsconfig.json) - Use explicit types for function parameters and return values
- Prefer interfaces over types for object shapes
- Use union types for component variants
- Example:
interface ITag {
value: string
isSelected: boolean
}
const toggleTag = (index: number): void => {
// implementation
}- Use TailwindCSS v4 with
@import "tailwindcss" - Utilize CSS custom properties for theme variables
- Prefer utility classes over custom CSS
- Use
classNamesutility for conditional styling - Break long class strings across multiple lines for readability
- Example:
className={classNames(
"flex items-center gap-2",
isActive ? "bg-blue-500 text-white" : "bg-gray-100 text-gray-700"
)}- Import from
motion/react - Use semantic motion components (
motion.div,motion.button) - Prefer
layoutprop for automatic animations - Configure transitions explicitly
- Example:
<motion.button
layout
transition={{
type: "spring",
mass: 1,
stiffness: 600,
damping: 15,
}}
className="..."
>- Use try-catch blocks for async operations
- Provide meaningful error messages
- Handle loading states appropriately
- Validate props in development
- Use React.memo for expensive components when needed
- Optimize re-renders with proper dependency arrays in useEffect
- Use Framer Motion's layout animations judiciously
- Consider virtualization for large lists
- Use conventional commit messages
- Run lint and type-check before committing
- Follow the existing branch naming patterns
- 2 spaces indentation (configured in .editorconfig)
- LF line endings
- UTF-8 encoding
- Final newline required
- Uses husky and lint-staged
- Automatically runs ESLint on staged JS/TS files
- Pre-commit hooks ensure code quality
No Cursor rules directory (.cursor/rules/) or .cursorrules file found.
No Copilot instructions file (.github/copilot-instructions.md) found.
- This project uses Next.js 16 with App Router
- TailwindCSS v4 is configured with CSS custom properties
- Font loading uses Next.js font optimization
- Analytics integration with Plausible
- Responsive design with mobile-first approach
- Focus on accessibility and semantic HTML