SvelteKit makes three read-only state objects available via the `$app/state` module — `page`, `navigating` and `updated`. ```js // @noErrors import { navigating, page, updated } from '$app/state'; ``` ## navigating A read-only object representing an in-progress navigation, with `from`, `to`, `type` and (if `type === 'popstate'`) `delta` properties. Values are `null` when no navigation is occurring, or during server rendering.
```dts const navigating: | Navigation | { from: null; to: null; type: null; willUnload: null; delta: null; complete: null; }; ```
## page A read-only reactive object with information about the current page, serving several use cases: - retrieving the combined `data` of all pages/layouts anywhere in your component tree (also see [loading data](/docs/kit/load)) - retrieving the current value of the `form` prop anywhere in your component tree (also see [form actions](/docs/kit/form-actions)) - retrieving the page state that was set through `goto` (also see [goto](/docs/kit/$app-navigation#goto) and [shallow routing](/docs/kit/shallow-routing)) - retrieving metadata such as the URL you're on, the current route and its parameters, the target of a shallow navigation, and whether or not there was an error ```svelte

Currently at {page.url.pathname}

{#if page.error} Problem detected {:else} All systems operational {/if} ``` Changes to `page` are available exclusively with runes. (The legacy reactivity syntax will not reflect any changes) ```svelte ``` On the server, values can only be read during rendering (in other words _not_ in e.g. `load` functions). In the browser, the values can be read at any time.
```dts const page: Page; ```
## updated A read-only reactive value that's initially `false`. SvelteKit checks for new versions on data, remote, and form action responses (via the `x-sveltekit-version` header), when the tab regains focus or becomes visible, and on a poll interval (see [`version.pollInterval`](/docs/kit/configuration#version)). `updated.current` is set to `true` when a new version is detected. `updated.check()` will force an immediate check, regardless of polling.
```dts const updated: { get current(): boolean; check(): Promise; }; ```
## Page The shape of the [`page`](/docs/kit/$app-state#page) reactive object.
```dts interface Page< Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>, RouteId extends AppRouteId | null = AppRouteId | null > {/*…*/} ```
```dts url: ReadonlyURL & { readonly pathname: ResolvedPathname | (string & {}) }; ```
The URL of the current page.
```dts params: Params; ```
The parameters of the current page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object.
```dts route: {/*…*/} ```
Info about the current route.
```dts id: RouteId; ```
The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched.
```dts status: number; ```
HTTP status code of the current page.
```dts error: App.Error | null; ```
The error object of the current page, if any. Filled from the `handleError` hooks.
```dts data: App.PageData & Record; ```
The merged result of all data from all `load` functions on the current page. You can type a common denominator through `App.PageData`.
```dts state: App.PageState; ```
The page state, which can be manipulated using [`goto`](/docs/kit/$app-navigation#goto) from `$app/navigation`.
```dts shallow: { /** Parameters of the target route, or `null` if the URL does not resolve to a route. */ params: AppLayoutParams<'/'> | null; /** Info about the target route, or `null` if the URL does not resolve to a route. */ route: { id: AppRouteId } | null; /** The normalized URL passed to `goto(..., { shallow: true })`. */ url: ReadonlyURL; } | null; ```
Information about the target of the current shallow navigation, or `null` if no shallow navigation has occurred.
```dts form: any; ```
Filled only after a form submission. See [form actions](/docs/kit/form-actions) for more info.
## ReadonlyURL
```dts type ReadonlyURL = Readonly< Omit & { searchParams: ReadonlyURLSearchParams; } >; ```
## ReadonlyURLSearchParams
```dts type ReadonlyURLSearchParams = Omit< URLSearchParams, 'set' | 'append' | 'delete' | 'sort' >; ```