Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
PoC on how to omit state from different pages in a Next.js application.
Next.js Layout State is a Boilerplate template that demonstrates how to omit state from different pages in a Next.js application. It is a proof-of-concept repository that provides a working example of managing layout-level state so it is not duplicated across pages.
Next.js Layout State is a proof-of-concept boilerplate for Next.js applications that shows a pattern for omitting state that belongs to the layout (such as navigation, sidebars, or modals) from individual pages. The project runs as a standard Next.js app: after cloning the repository and running npm install and npm run dev, a local demo is served at http://localhost:3000. The template is built with Next.js 11+, React 17+, and TypeScript 4.3+, and the source is published in the atilafassina/nextjs-layout-state GitHub repository.
npm run dev development workflow.nextjs-layout-state.netlify.app so you can see the intended behavior before cloning.npm install then npm run dev to explore the layout state pattern locally at http://localhost:3000.The repository provides the minimal setup steps described in its README: clone the repo, install dependencies with npm i, and start the development server with npm run dev. For deployment, the Netlify button triggers a new site build from the GitHub repository, and the live demo is continuously deployed at nextjs-layout-state.netlify.app.
It is a proof of concept that shows how to omit state from different pages in a Next.js application, addressing the common problem of layout-level state being unnecessarily repeated or persisted.
Clone the repository, run npm i to install dependencies, and then npm run dev to start the development server at http://localhost:3000.
The README's support table lists Next.js 11 and above, React 17 and above, and TypeScript 4.3 and above as the required dependency versions.
Yes, the GitHub repository includes a "Deploy to Netlify" button that starts a new deployment directly from the repo, and the current live demo is hosted on Netlify.
Yes, the template is configured with TypeScript 4.3 or later, so you get typed components and state definitions out of the box.
