+ We recommend building UIs with a
+
+ component-driven
+
+ process starting with atomic components and ending with pages.
+
+
+ Render pages with mock data. This makes it easy to build and review page states without
+ needing to navigate to them in your app. Here are some handy patterns for managing page data
+ in Storybook:
+
+
+
+ Use a higher-level connected component. Storybook helps you compose such data from the
+ "args" of child component stories
+
+
+ Assemble data in the page component from your services. You can mock these services out
+ using Storybook.
+
+
+
+ Get a guided tutorial on component-driven development at
+
+ Storybook tutorials
+
+ . Read more in the
+ docs
+ .
+
+
+ Tip
+ Adjust the width of the canvas with the
+
+ Viewports addon in the toolbar
+
+ We recommend building UIs with a
+
+ component-driven
+
+ process starting with atomic components and ending with pages.
+
+
+ Render pages with mock data. This makes it easy to build and review page states without
+ needing to navigate to them in your app. Here are some handy patterns for managing page data
+ in Storybook:
+
+
+
+ Use a higher-level connected component. Storybook helps you compose such data from the
+ "args" of child component stories
+
+
+ Assemble data in the page component from your services. You can mock these services out
+ using Storybook.
+
+
+
+ Get a guided tutorial on component-driven development at
+
+ Storybook tutorials
+
+ . Read more in the
+ docs
+ .
+
+
+ Tip
+ Adjust the width of the canvas with the
+
+ Viewports addon in the toolbar
+
+ We recommend building UIs with a
+
+ component-driven
+
+ process starting with atomic components and ending with pages.
+
+
+ Render pages with mock data. This makes it easy to build and review page states without
+ needing to navigate to them in your app. Here are some handy patterns for managing page data
+ in Storybook:
+
+
+
+ Use a higher-level connected component. Storybook helps you compose such data from the
+ "args" of child component stories
+
+
+ Assemble data in the page component from your services. You can mock these services out
+ using Storybook.
+
+
+
+ Get a guided tutorial on component-driven development at
+
+ Storybook tutorials
+
+ . Read more in the
+ docs
+ .
+
+
+ Tip
+ Adjust the width of the canvas with the
+
+ Viewports addon in the toolbar
+
+ We recommend building UIs with a
+
+ component-driven
+
+ process starting with atomic components and ending with pages.
+
+
+ Render pages with mock data. This makes it easy to build and review page states without
+ needing to navigate to them in your app. Here are some handy patterns for managing page data
+ in Storybook:
+
+
+
+ Use a higher-level connected component. Storybook helps you compose such data from the
+ "args" of child component stories
+
+
+ Assemble data in the page component from your services. You can mock these services out
+ using Storybook.
+
+
+
+ Get a guided tutorial on component-driven development at
+
+ Storybook tutorials
+
+ . Read more in the
+ docs
+ .
+
+
+ Tip
+ Adjust the width of the canvas with the
+
+ Viewports addon in the toolbar
+
+ *
+ * ```
+ */
+ depends: (...deps: Array<`${string}:${string}`>) => void;
+ /**
+ * Use this function to opt out of dependency tracking for everything that is synchronously called within the callback. Example:
+ *
+ * ```js
+ * /// file: src/routes/+page.server.js
+ * export async function load({ untrack, url }) {
+ * // Untrack url.pathname so that path changes don't trigger a rerun
+ * if (untrack(() => url.pathname === '/')) {
+ * return { message: 'Welcome!' };
+ * }
+ * }
+ * ```
+ */
+ untrack: (fn: () => T) => T;
+
+ /**
+ * Access to spans for tracing. If tracing is not enabled or the function is being run in the browser, these spans will do nothing.
+ * @since 2.31.0
+ */
+ tracing: {
+ /** Whether tracing is enabled. */
+ enabled: boolean;
+ /** The root span for the request. This span is named `sveltekit.handle.root`. */
+ root: Span;
+ /** The span associated with the current `load` function. */
+ current: Span;
+ };
+}
+
+export interface NavigationEvent<
+ Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>,
+ RouteId extends AppRouteId | null = AppRouteId | null
+> {
+ /**
+ * The parameters of the current page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object
+ */
+ params: Params;
+ /**
+ * Info about the current route
+ */
+ route: {
+ /**
+ * 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.
+ */
+ id: RouteId;
+ };
+ /**
+ * The URL of the current page
+ */
+ url: URL;
+}
+
+/**
+ * Information about the target of a specific navigation.
+ */
+export interface NavigationTarget<
+ Params extends AppLayoutParams<'/'> = AppLayoutParams<'/'>,
+ RouteId extends AppRouteId | null = AppRouteId | null
+> {
+ /**
+ * Parameters of the target page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object.
+ * Is `null` if the target is not part of the SvelteKit app (could not be resolved to a route).
+ */
+ params: Params | null;
+ /**
+ * Info about the target route
+ */
+ route: {
+ /**
+ * 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.
+ */
+ id: RouteId | null;
+ };
+ /**
+ * The URL that is navigated to
+ */
+ url: URL;
+ /**
+ * The scroll position associated with this navigation.
+ *
+ * For the `from` target, this is the scroll position at the moment of navigation.
+ *
+ * For the `to` target, this represents the scroll position that will be or was restored:
+ * - In `beforeNavigate` and `onNavigate`, this is only available for `popstate` navigations (back/forward button)
+ * and will be `null` for other navigation types, since the final scroll position isn't known
+ * ahead of time.
+ * - In `afterNavigate`, this is always the scroll position that was applied after the navigation
+ * completed.
+ */
+ scroll: { x: number; y: number } | null;
+}
+
+/**
+ * - `enter`: The app has hydrated/started
+ * - `form`: The user submitted a `