Skip to content

Commit 3344ae2

Browse files
committed
docs: add JSDoc example for viewport configuration
1 parent 782bb9a commit 3344ae2

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

  • packages/meta/src/types

packages/meta/src/types/io.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,31 @@ export type InputMetadata = {
420420
* @see https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-icon
421421
*/
422422
icons?: NextMetadata["icons"];
423+
/**
424+
* Interface for the viewport configuration.
425+
*
426+
* @remarks
427+
* This configuration allows defining properties such as width, initial scale, theme colors,
428+
* and color scheme.
429+
*
430+
* @example
431+
* ```tsx
432+
* viewport: {
433+
* width: "device-width",
434+
* initialScale: 1,
435+
* themeColor: [
436+
* { media: "(prefers-color-scheme: dark)", color: "#000000" },
437+
* { media: "(prefers-color-scheme: light)", color: "#ffffff" }
438+
* ],
439+
* colorScheme: "dark"
440+
* }
441+
* // Renders:
442+
* // <meta name="viewport" content="width=device-width, initial-scale=1" />
443+
* // <meta name="theme-color" media="(prefers-color-scheme: dark)" content="#000000" />
444+
* // <meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff" />
445+
* // <meta name="color-scheme" content="dark" />
446+
* ```
447+
*/
423448
viewport?: Viewport;
424449
};
425450

0 commit comments

Comments
 (0)