Creating your first page
Create a page file
Create a new file in the This page is now accessible at
app/pages/ directory. The filename determines the route:app/pages/about.js
/about.Nested routes
Create nested routes by organizing pages in subdirectories:app/pages/blog/post-1.js
Server Components by default
All pages are React Server Components, which means they:- Run only on the server
- Can use async/await for data fetching
- Have access to server-only APIs
- Don’t increase the client bundle size
app/pages/features/server-components.js
Using Suspense for streaming
Wrap slow components inSuspense to stream content progressively:
app/pages/features/streaming.js
Adding client interactivity
To add client-side interactivity, import client components:app/pages/interactive.js
app/components/counter.js
Linking between pages
Use standard HTML<a> tags for navigation. COSMOS RSC automatically handles client-side routing:
useRouter hook in client components (see Client Navigation).