Types and exports
Static viewport configuration
Use a static viewport export for page or layout settings that do not depend on route data. It belongs to the server-side metadata layer. Avoid disabling user zoom, which can harm accessibility. Do not export both viewport and generateViewport from one segment. Example context: Next.js 16.x documentation lane; illustrative snippet or file tree, not executed. Exact candidate patch 16.4.6 remains unverified. Expected behavior / verification: Inspect viewport and theme-color metadata after a direct navigation. Check zoom remains available on a mobile browser.
Formal Syntax & Structure
nextjs syntaxnextjs
export const viewport: Viewport = {...}Working Example
Example Snippetnextjs
import type { Viewport } from 'next';export const viewport: Viewport = { width: 'device-width', initialScale: 1, themeColor: '#254b3b' };