| title | API Reference |
|---|---|
| layout | default |
| nav_order | 7 |
This page is a compact map of the public surface currently provided by NextFs.
It is not intended to replace the source file. Its purpose is to help you find the right module quickly when translating an App Router example from JavaScript or TypeScript into F#.
Items marked experimental depend on Next.js experimental flags or unstable_* upstream functions and may change without a NextFs major bump.
Bindings for next/font/local.
Common members:
Font.local
Related helpers and types:
FontOptionsLocalFontSourceFontDeclarationLoadedFontFontStyleObjectFontDisplay
Generated named bindings for next/font/google.
Examples:
GoogleFont.InterGoogleFont.RobotoGoogleFont.Roboto_Mono
For real next/font entry modules, prefer anonymous-record or object-literal options so Next.js can statically analyze the loader call.
Bindings for next/link.
Common members:
Link.createLink.hrefLink.hrefObjectLink.replaceLink.scrollLink.prefetchLink.prefetchAutoLink.onNavigateLink.transitionTypes
Client-only bindings for next/link.
Common members:
LinkClient.useLinkStatus
Bindings for next/image.
Common members:
Image.createImage.getImagePropsImage.srcImage.altImage.widthImage.heightImage.fillImage.sizesImage.qualityImage.preloadImage.priorityImage.loadingImage.placeholderImage.blurDataUrlImage.unoptimizedImage.overrideSrc
Related types:
ImagePropsResult
Bindings for next/script.
Common members:
Script.createScript.srcScript.strategyScript.idScript.onLoadScript.onReadyScript.onError
Bindings for next/form.
Common members:
Form.createForm.actionForm.serverActionForm.replaceForm.scrollForm.prefetch
Bindings for next/head.
Common member:
Head.create
Server-safe bindings for next/navigation.
Common members:
Navigation.redirectNavigation.redirectWithNavigation.permanentRedirectNavigation.notFoundNavigation.forbidden— experimental, requiresexperimental.authInterrupts: trueNavigation.unauthorized— experimental, requiresexperimental.authInterrupts: trueNavigation.unstableRethrow
Related types:
AppRouterInstanceLinkStatusNavigateOptionsPrefetchOptionsReadonlyURLSearchParamsURLSearchParamsCollectionRedirectType
These map to the App Router special files:
Navigation.notFound()->not-found.jsNavigation.forbidden()->forbidden.jsNavigation.unauthorized()->unauthorized.js
Client-only bindings for App Router hooks.
Common members:
NavigationClient.useRouterNavigationClient.usePathnameNavigationClient.useSearchParamsNavigationClient.useParamsNavigationClient.useSelectedLayoutSegmentNavigationClient.useSelectedLayoutSegmentsNavigationClient.useSelectedLayoutSegmentForNavigationClient.useSelectedLayoutSegmentsForNavigationClient.useServerInsertedHTMLNavigationClient.unstableIsUnrecognizedActionError— experimental, wraps upstreamunstable_*function
Bindings for next/web-vitals.
Common members:
WebVitals.useReportWebVitals
Related types:
WebVitalMetricWebVitalMetricRatingWebVitalNavigationType
Bindings for next/headers and request-context helpers from next/server.
Common members:
Server.afterServer.afterAsyncServer.headersServer.cookiesServer.draftModeServer.connectionServer.userAgentServer.userAgentFromString
Related types:
HeadersCollectionRequestCookieStoreCookieOptionsCookiePriorityCookieSameSiteDraftModeStateUserAgentInfoUserAgentBrowserUserAgentDeviceUserAgentEngineUserAgentOperatingSystemUserAgentCpuNextRequestNextUrlFormDataCollection
Constructors for NextRequest.
Common members:
ServerRequest.createServerRequest.createFromServerRequest.createWithInitServerRequest.createFromWithInit
Related helpers and types:
NextRequestInitNextConfig
Static helpers over NextResponse.
Common members:
ServerResponse.createServerResponse.createWithBodyServerResponse.createWithInitServerResponse.jsonServerResponse.jsonWithInitServerResponse.redirectServerResponse.redirectWithInitServerResponse.rewriteServerResponse.rewriteWithInitServerResponse.nextServerResponse.nextWithInit
Related types:
NextResponseResponseInitNextResponseInitResponseCookieStore
NextRequest and NextResponse also expose common Web Request / Response members used in route handlers and proxy flows:
clonearrayBufferblobformDatabodyUsed
Bindings for Next.js server fetch() usage.
Common members:
ServerFetch.fetchServerFetch.fetchWithInitServerFetch.fetchFromServerFetch.fetchFromWithInit
Related helpers and types:
ServerFetchInitNextFetchOptionsServerFetchResponseServerFetchCacheRevalidate
Bindings used for proxy.js. Experimental — proxy support varies by Next.js version.
Common members:
ProxyConfig.createProxyConfig.matcherProxyConfig.matchersProxyConfig.matchersManyProxyConfig.regionsProxyConfig.regionsManyProxyConfig.allowDynamicProxyConfig.allowDynamicManyProxyMatcher.createProxyMatcher.sourceProxyMatcher.localeFalseProxyMatcher.hasProxyMatcher.missingRouteHas.createRouteHas.type'RouteHas.keyRouteHas.value
Related types:
NextFetchEventRouteHasType
Types intended for root instrumentation.js and instrumentation-client.js files.
Common types:
InstrumentationErrorInstrumentationRequestInstrumentationContextInstrumentationRouterKindInstrumentationRouteTypeInstrumentationRenderSourceInstrumentationRevalidateReasonInstrumentationRenderTypeRouterTransitionType
Types intended for App Router special files:
ErrorBoundaryPropsErrorWithDigestTemplatePropsDefaultProps<'T>
These are typically used with:
error.jsglobal-error.jstemplate.jsdefault.js
Use:
NextRequestRouteHandlerContext<'T>[<CompiledName("GET")>],[<CompiledName("POST")>], and similar attributes
Inline directives currently provided:
Directive.useServer()Directive.useCache()Directive.useCachePrivate()— experimental, requiresexperimental.dynamicIODirective.useCacheRemote()— experimental, requiresexperimental.dynamicIO
Bindings for next/cache.
Common members:
Cache.cacheLifeProfileCache.cacheLifeProfileNameCache.cacheLifeCache.cacheTagCache.cacheTagsCache.refreshCache.revalidatePathCache.revalidatePathTypeCache.revalidateTagCache.revalidateTagWithProfileCache.revalidateTagWithCustomProfileCache.updateTagCache.noStore
Related helpers and types:
CacheLife.createCacheLife.staleCacheLife.revalidateCacheLife.expireCacheProfileRevalidatePathTypeRevalidateTagProfile
Top-level metadata object builders for layout/page exports.
Common members:
Metadata.createMetadata.titleMetadata.titleTemplateMetadata.descriptionMetadata.applicationNameMetadata.generatorMetadata.keywordsMetadata.creatorMetadata.publisherMetadata.metadataBaseMetadata.alternatesMetadata.openGraphMetadata.twitterMetadata.robotsMetadata.manifestMetadata.iconsMetadata.verificationMetadata.other
Related helper modules:
MetadataTitleMetadataImageMetadataAlternatesMetadataOpenGraphMetadataTwitterMetadataVerificationThemeColorViewport
Builders for App Router metadata route files.
Common submodules:
MetadataRoute.RobotsRuleMetadataRoute.RobotsMetadataRoute.SitemapEntryMetadataRoute.ManifestIconMetadataRoute.Manifest
Related types:
MetadataRoute.SitemapChangeFrequency
Builders for generateImageMetadata results.
Common members:
ImageMetadata.createImageMetadata.idImageMetadata.altImageMetadata.sizeImageMetadata.contentType
Related helpers:
ImageMetadataSizeImageGenerationProps<'routeParams, 'id>
Bindings for ImageResponse from next/og.
Common members:
ImageResponse.createImageResponse.createWithOptions
Related helpers and types:
ImageResponseOptionsImageResponseFontImageResponseEmojiImageResponseFontStyle
Utility interfaces for async App Router props:
PageProps<'routeParams, 'searchParams>LayoutProps<'routeParams>ResolvingMetadataResolvingViewportSitemapProps
Href.createHref.pathnameHref.queryHref.hashPreferredRegion.autoPreferredRegion.globalRegionPreferredRegion.homePreferredRegion.regionPreferredRegion.regionsGenerateSitemapsEntry.createGenerateSitemapsEntry.idRevalidate.foreverRevalidate.neverCacheRevalidate.secondsRouteRuntimeLoadedFontScriptStrategyImageLoadingImagePlaceholder
Marks an F# module as a Next.js App Router entry point. The scanner (tools/nextfs-scan.mjs) reads this attribute to auto-generate nextfs.entries.json.
Must be placed immediately before the module declaration, before any open statements. Use the fully-qualified form [<NextFs.NextFsEntry(...)>].
[<NextFs.NextFsEntry("app/page.js", Directive="use client", Default="Page")>]
module App.PageParameters:
output(positional): wrapper output path, e.g."app/page.js"Directive:"use client"or"use server"(optional)Default: named F# binding to re-export as the JavaScript defaultNamed: space-separated list of named exports, e.g."metadata viewport"ExportAll:trueto emitexport * from ...
Adds a static literal export to the generated wrapper. Use when Next.js needs a statically-analyzable literal that Fable cannot guarantee to produce.
[<NextFs.NextFsEntry("proxy.js", Named="proxy")>]
[<NextFs.NextFsStaticExport("config", """{"matcher":["/((?!_next).*)"]}""")>]
module ProxyParameters:
name(positional): export name, e.g."config"json(positional): JSON string to inline as the exported value
- Keep route handlers and multi-argument server actions uncurried.
- Annotate entry modules with
[<NextFs.NextFsEntry>]and runnpm run scaninstead of writingnextfs.entries.jsonby hand. - Use wrapper files for file-level
'use client'and'use server'. - For a full project layout, see the starter example.