dani-mp / next-modal

An example of a modal controlled with search params in Next.js 13.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example showcasing a page inside a nested layout with a modal controlled by the search params.

  • Go to /one/two and click on the numbers to open the modal with the selected number. See how the modal search param changes accordingly.
  • Closing the modal "cleans" the modal search param.
  • Navigating to the page without the modal search param doesn't show the modal.
  • Navigating to the page with the modal search param shows the modal.

Run locally

This is a Next.js project bootstrapped with create-next-app.

First, install the dependencies:

npm i

Second, run the development server:

npm run dev

Open http://localhost:3000 with your browser to see the result.

About

An example of a modal controlled with search params in Next.js 13.


Languages

Language:CSS 59.1%Language:TypeScript 39.7%Language:JavaScript 1.2%