SSR and enhancement

Page Sections components can render meaningful HTML on the server. The host application must enable SSR or prerendering; importing the library into a client-only application does not provide either automatically.

What works without application JavaScript?

FeatureInitial HTML / CSS behaviorClient enhancement
Pages, sections, gridsText, headings, backgrounds and responsive layoutReactive updates
CardGridSectionOne set of articles, images and native title linksOptional application snippets
CarouselSectionSame content model; focusable native overflow with scroll snapOptional previous/next buttons after mount
MainMenuNative links and details/summary disclosuresNo additional menu engine
ButtonGroupNative links; rendered buttonsButton callbacks require JavaScript
Breadcrumbs / SectionNavigationNative links, including generated page anchorsRegistration changes and keyed reorder updates
ImageNative picture, alt text and dimensionsExplicit shell mode changes can update source selection
HTML5 videoNative controls and caption tracksBrowser media behavior
YouTubeEmbed elementProvider playback may require its own scripts/network

Carousel scrolling supports touch/trackpad and native arrow-key behavior when the track has focus. Links remain normal Tab stops. Buttons scroll by 85% of track width, respect RTL and avoid smooth movement when reduced motion is requested. No alternate copy of the cards is created for SSR or failure fallback.

Host responsibilities

Use SvelteKit's normal server rendering or prerendering, or supply a server-render/prerender pipeline for plain Svelte. Ensure your initial data is available at render time and use the same data for hydration. Select persisted themes in the host if you need to avoid a theme flash. Supply image dimensions, routes, media files, consent handling and appropriate text alternatives.

In SvelteKit, a page can opt into prerendering when its content is available at build time:

ts
// src/routes/+page.ts in a SvelteKit application
export const prerender = true;

This export is a host configuration, not a Page Sections prop.

Demo reference

The SvelteKit 2 demo in apps/demo uses adapter-static and prerender = true in its root layout. The website, minimal demo and regression application all produce complete HTML and hydrate it in the browser. npm run dev:website serves the documentation at http://127.0.0.1:5174. npm run demo builds and previews the minimal consumer at http://127.0.0.1:4173. SvelteKit is an application dependency only.

Inspect page source and test with JavaScript disabled. The repository's browser tests cover 375/840/1600px widths, native carousel keyboard scrolling and a hydrated environment without WebGPU. The package has no WebGPU dependency or GPU detection behavior.

Accessibility limits

ContentPage's generated navigation comes after sections in DOM order and is moved visually with CSS. Native scrolling is not a live-region slideshow. The library does not automatically choose heading levels in arbitrary Markdown/snippets, announce slide changes, or implement application-level focus restoration. Review those decisions in your actual page composition.

Related: CarouselSection, Installation, demo development guide.