Solid
Use the Solid package for common rendering, effects, and the layout boundary. Solid Router and SolidStart pass the same getRoute as framework.
Common setup
Install @ssgoi/solid and keep one Ssgoi provider above the routed children. The provider is independent of Solid Router.
import { Ssgoi } from "@ssgoi/solid";
import { drill } from "@ssgoi/solid/view-transitions";Transition state
A page that scrolls itself on arrival, such as an anchor jump or scrollIntoView, fights the animation. Read the provider's transition state and act once it is idle. The status is idle or transitioning; while transitioning it also carries from, to and direction. It flips as soon as the navigation is paired, one microtask after the DOM changed, and returns to idle when the run releases, the same span the scroll-input lock covers. useSsgoiTransition returns a signal accessor.
import { createEffect } from "solid-js";
import { useSsgoiTransition } from "@ssgoi/solid";
export function Comments() {
const transition = useSsgoiTransition();
createEffect(() => {
if (transition().status !== "idle") return;
document.getElementById("comments")?.scrollIntoView();
});
return null;
}Solid Router
Experimental APIReturn Solid Router’s location pathname from framework.getRoute on the common provider. SolidStart uses this same setup.
Wrap the routed children
Render the provider inside <Router> so useLocation works. The keyed boundary recreates the changing region; config.layouts can keep an outer shell mounted. SsgoiLayoutBoundary throws if <Ssgoi> has no framework.
import { Router, useLocation, type RouteSectionProps } from "@solidjs/router";
import { Ssgoi, SsgoiLayoutBoundary } from "@ssgoi/solid";
import { config } from "./ssgoi-config";
function Root(props: RouteSectionProps) {
const location = useLocation();
return (
<Ssgoi config={config} framework={{ getRoute: () => ({ pathname: location.pathname }) }}>
<SsgoiLayoutBoundary>{props.children}</SsgoiLayoutBoundary>
</Ssgoi>
);
}
<Router root={Root}>{/* routes */}</Router>Route lifetime
The default key follows the pathname. A boundary at depth N instead keys by the config.layouts scope that matches at depth N, so a section declared there stays mounted while its inner boundary swaps.
SolidStart
Experimental APIReturn Solid Router’s location pathname from framework.getRoute in the SolidStart router root.
Setup
// src/app.tsx
import { Router, useLocation, type RouteSectionProps } from "@solidjs/router";
import { FileRoutes } from "@solidjs/start/router";
import { Suspense } from "solid-js";
import { Ssgoi, SsgoiLayoutBoundary } from "@ssgoi/solid";
import { drill } from "@ssgoi/solid/view-transitions";
const config = {
transitions: [{ on: "/**", except: "/", transition: drill() }],
};
function Root(props: RouteSectionProps) {
const location = useLocation();
return (
<main class="relative z-0 min-h-dvh overflow-x-clip">
<Ssgoi config={config} framework={{ getRoute: () => ({ pathname: location.pathname }) }}>
<Suspense>
<SsgoiLayoutBoundary>{props.children}</SsgoiLayoutBoundary>
</Suspense>
</Ssgoi>
</main>
);
}
export default function App() {
return (
<Router root={Root}>
<FileRoutes />
</Router>
);
}Beyond the basics
For a persistent /shop shell, declare it in config.layouts as [{ paths: "/shop/**" }] and put a prop-less boundary only around the changing content in routes/shop.tsx, around props.children. The root boundary (depth 0) keeps one key for every /shop route, so the header and tabs stay; the inner boundary (depth 1) keys by the path and produces the child transitions.
Each router connects through the provider's framework prop. Route boundaries explains how to connect another router directly. Transitions and route rules apply across the web frameworks.