0
0
NextJSframework~5 mins

Parallel routes (@slot) in NextJS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of parallel routes in Next.js using @slot?
Parallel routes let you show different parts of the UI at the same time, like sidebars or modals, without replacing the main page content. The <code>@slot</code> syntax marks where these extra routes appear.
Click to reveal answer
intermediate
How do you define a parallel route in Next.js app router?
You create a folder with the route name inside parentheses, like @sidebar, and inside it, add a page.tsx. Then in the main layout, use {@sidebar} to show it.
Click to reveal answer
beginner
What does the @slot syntax do in Next.js layouts?
It tells Next.js where to render the content of a parallel route. It acts like a placeholder for that route's UI inside the main layout.
Click to reveal answer
intermediate
Can parallel routes update independently without reloading the main page in Next.js?
Yes! Parallel routes let parts of the UI update separately, so you can change a sidebar or modal without reloading the whole page.
Click to reveal answer
intermediate
Why might you use parallel routes instead of nested routes in Next.js?
Parallel routes let you show multiple UI sections side-by-side or overlayed, like a sidebar and main content, without forcing one inside the other. Nested routes replace or nest content, but parallel routes run alongside.
Click to reveal answer
In Next.js, what does the @slot syntax specify?
AThe data fetching method
BWhere to render a parallel route's content
CThe CSS class for styling
DThe URL path of a route
How do you name a folder to create a parallel route in Next.js app router?
AWith parentheses, like (sidebar)
BWith square brackets, like [sidebar]
CWith curly braces, like {sidebar}
DWith angle brackets, like <sidebar>
What happens if you omit @slot in a layout for a parallel route?
AThe route renders twice
BThe app crashes
CThe route becomes the main route
DThe parallel route content won't render in that layout
Which UI pattern is best suited for parallel routes in Next.js?
ASingle full-page form
BSimple page navigation
CSidebar or modal alongside main content
DStatic content only
Can parallel routes in Next.js update independently without reloading the whole page?
AYes, they update separately
BNo, they reload the entire page
COnly if using server components
DOnly with client-side routing
Explain how parallel routes work in Next.js and the role of the @slot syntax.
Think about showing a sidebar and main content together.
You got /3 concepts.
    Describe a real-life example where using parallel routes with @slot in Next.js improves user experience.
    Imagine a shopping site with filters on the side.
    You got /3 concepts.