Dev Helpers

Developer journal

Next.js

App Router patterns for routes, layouts, server rendering and navigation.

← All categories

Next.js

Free bin volume

Free storage volume depends on consistent dimensions and units. Derive capacity and usage in the same unit before formatting a human-readable summary.

Draft preview indexing

Draft pages need deliberate indexing metadata. An indexing directive controls crawler intent, while access to unpublished material needs a separate permission check.

Party size allocation

Allocating a party into groups is an integer problem. The remainder determines whether another group is needed and how full it will be.

Locale preserving contact link

Localized links should retain the active language segment. Validate supported locales before inserting user-controlled segments into a destination.

Preferred unit label

Unit preferences might arrive from a cookie, query or default setting. Validate the chosen value before incorporating it into a label.

Bindery dispatch estimate

A dispatch estimate needs a clear starting date and handling-time rule. Disclose what happens on non-working days if the estimate is shown to customers.

Server keyword summary

A server-rendered keyword summary can be rebuilt directly from the request URL. Normalize whitespace and handle duplicate query keys deliberately.

Parent route link

A parent link needs to understand route structure. Removing the last character sequence can accidentally discard a locale or a meaningful base segment.

Validated view label

A query parameter describes a requested view but does not establish that the view exists. Match it against supported values before rendering its label.

Missing guide navigation

A missing guide page should help readers recover context. Link to the relevant index and keep the missing resource's status accurate.

Reading width layout

A shared reading layout keeps text measure consistent across sibling articles. A wide illustration may need a controlled exception to the prose width.

Optional documentation index

An optional catch-all can match both a section root and a nested path. The root case needs a useful page when the parameter is absent.

Nested section title

A nested layout can supply section context once for all of its children. Keep the page-specific heading under that shared context.

Quiet optional slot

A default component for a parallel route slot gives the router a fallback on a hard reload. Choose a quiet fallback when the slot is optional.

Previous results link

A previous-page link should preserve active filters and prevent a move below the first page. Construct its query from validated state.

Fresh route disclosure

Refreshing an App Router route fetches a new server payload while preserving eligible client state. Cached data may still require its own invalidation.

Comparison route shortcut

A comparison shortcut can encode the chosen items in its destination. Preserve the identifiers needed to reconstruct the same view on refresh.

Search route form

A GET search form produces a shareable query string. Give the input a name and ensure the results page understands an empty search.

Retry route segment

A segment error boundary can offer a retry for a transient failure. Resetting the boundary rerenders the segment and does not guarantee the cause has cleared.

Triage status totals

Triage counts come from grouping records by status. Include zero-count states explicitly if the dashboard must always display the same columns.

Prefetched guide link

An internal Link can prepare a route ahead of navigation. Prefetch behaviour depends on production mode and the route being linked.

Small avatar image

Image geometry and alternative text still matter at avatar size. Reserve width and height to prevent a row from shifting while the image loads.

Collapsible activity slot

A collapsible activity slot separates secondary content from the main route. Choose whether its open state should persist between sibling pages.

Accessible route progress

Route progress feedback should announce meaningful changes without interrupting every interaction. Identify which loading boundary the message belongs to.

Programmatic library navigation

Programmatic navigation belongs in an interactive client boundary. Use a normal link when the destination is already known and no event logic is required.

Client slug display

A client component can read route parameters to display the current slug. Validate whether the matched segment is a string or an array.

Easiest park recommendation

A recommendation needs a scoring rule that readers can understand. An equal score or an empty candidate list requires an intentional fallback.

Receivables balance

Receivables reporting distinguishes invoiced, paid and outstanding amounts. Money values should retain a defined unit throughout the server calculation.

Slug title formatter

Turning a slug into a display title is a fallback for missing editorial metadata. Acronyms and proper names often need an explicit title override.

Article directory links

A directory of article links should point to canonical page paths. Stable slugs keep bookmarks working when the visual title changes.