Overview
Next.js 15 combines the best of React with server-side rendering, static site generation, and a comprehensive component library.Pre-installed Packages
- Next.js 15.3.3: Latest React framework with App Router
- Shadcn/ui: Comprehensive component library (CLI-first)
- Tailwind CSS v4: Utility-first CSS framework
- TypeScript: Full type safety
- Lucide React: Icon library
Key Features
- App Router with file-based routing
- Server and Client Components
- Built-in API routes
- Image optimization
- Font optimization
- Fast Refresh for instant feedback
Use Cases
Next.js 15 is best suited for:Full-Stack Apps
Applications requiring both frontend and backend logic with API routes
SEO-Focused Sites
Websites that need server-side rendering for optimal SEO performance
E-commerce
Online stores with product pages, dynamic routing, and server actions
Content Sites
Blogs, documentation sites, and content-heavy applications
Shadcn/ui Components
Shadcn/ui provides production-ready components that you can copy and customize. All components are pre-installed in ZapDev sandboxes.Available Components
- Layout: Card, Separator, Tabs, Accordion
- Forms: Button, Input, Select, Checkbox, Radio, Switch
- Data Display: Table, Badge, Avatar, Calendar
- Feedback: Alert, Dialog, Toast, Progress
- Navigation: Dropdown Menu, Navigation Menu, Breadcrumb
- Overlays: Sheet, Popover, Tooltip, Command
Component Usage
- Card
- Form
- Dialog
Critical Rules
Pre-installed Components: All Shadcn components are pre-installed. Just import and use them directly without running the CLI.
File Conventions
- Main file:
app/page.tsx - Components: PascalCase names, kebab-case filenames (
.tsx) - Imports: Use
@/alias for absolute imports - Utilities: Import
cnfrom@/lib/utils, not fromcomponents/ui
Project Structure
Workflow
When ZapDev generates Next.js code, it follows this workflow:- Generate files: Creates all component and page files
- Install packages: Runs
npm install <package> --yesfor additional dependencies - Validate: Runs
npm run lintandnpm run buildto ensure code quality - Summary: Provides a task summary of what was built
Development servers are not started in ZapDev sandboxes. Code is validated using build and lint commands.
Advanced Features
Server Components
By default, all components in the App Router are Server Components:Client Components
For interactivity, add"use client" at the top:
Styling with Tailwind
Combine Shadcn components with Tailwind utilities:Best Practices
Use the cn utility for conditional classes
Use the cn utility for conditional classes
Extract reusable components
Extract reusable components
Break complex UIs into smaller components in
components/ directory:Inspect component APIs before using
Inspect component APIs before using
Use the readFiles tool to check component props and variants before implementation.
Build surfaces with Shadcn primitives
Build surfaces with Shadcn primitives
Use Shadcn components as building blocks instead of bare HTML elements.