Skip to content

Samples ​

The samples repository shows Picard.js in all kinds of applications: single-page apps, server-side rendering with streaming, static site generators, backends written in other languages, desktop and mobile apps, a browser extension, and unit tests. Every sample has a README explaining what Picard.js does there and exactly where it is integrated.

TIP

Looking for a starting point? Pick the sample closest to your stack, then read the matching integration guide: Single-Page Apps, Server-Side Rendering, Desktop & Mobile Apps, or Testing.

Rendering in the Browser ​

SampleStackWhere Picard.js is integrated
Angular SPAAngular 19main.ts next to bootstrapApplication, CUSTOM_ELEMENTS_SCHEMA
React SPAReact 19, Vitemain.tsx, JSX typing for pi-component
Svelte SPASvelte 5, Vitemain.ts, no configuration needed
Vue SPAVue 3, Vitemain.ts, isCustomElement
RsbuildRsbuild 2, Module Federationa Module Federation host sharing its remotes with Picard.js

Rendering on the Server ​

SampleStackWhere Picard.js is integrated
Angular SSRAngular 19, Expressserver.ts decorates the response of the Angular engine
ASP.NET Core.NET 10a middleware calls a decorator service
BunBunBun.serve routes, incl. Native Federation on the server
DenoDeno 2Deno.serve with an npm: import
Hotwire TurboExpress, Turbo 8each route decorates its page; Turbo swaps the body
htmxPython, FastAPIa middleware decorates pages and htmx fragments via a decorator service
Next.jsNext.js 16async Server Components in Suspense (streaming)
NuxtNuxt 4a Nitro plugin (render:html, render:response)
React RouterReact Router 8loaders return decorate promises, rendered with Await (streaming)
SolidStartSolidStart 2a middleware; a signal bound to data
SvelteKitSvelteKit 3transformPageChunk in hooks.server.ts
TanStack StartTanStack Start 1server functions called by isomorphic loaders, rendered with Await (streaming)

Rendering at Build Time ​

SampleStackWhere Picard.js is integrated
AstroAstro 7a middleware and a static endpoint for the islands script
HugoHugoa decorator CLI runs after hugo
QwikQwik City 1a server$ function in a component

Desktop, Mobile, and Other Environments ​

SampleStackWhere Picard.js is integrated
Browser extensionChromium, Manifest V3browser script and micro frontends bundled into the extension
CapacitorCapacitor 8picard-js/client with a feed combining bundled and remote micro frontends
ElectronElectron 35browser script in the renderer
React NativeExpo 57a WebView on iOS / Android, the DOM on the web
TauriTauri 2main.ts in the webview
VitestVitest 5, jsdom, happy-domthe page under test starts picard-js/client

The Demo Micro Frontends ​

All samples use the picard-demos feed (https://feed.piral.cloud/api/v1/microfrontends/picard-demos). Its micro frontends are framework-less on purpose, and each one uses a different format:

Micro frontendFormatComponentRendering
mf-simple-htmlModule Federationcolumnclient only
nfsimplehtmlNative Federationcolumnclient only
pi-simple-htmlPiletcounterclient only
pi-ssr-htmlPiletssr-counterserver and client (hydrated)
nf-ssr-htmlNative Federationssr-likesserver and client (hydrated)

The sources of the two server-renderable micro frontends are part of the samples repository. They're a compact reference for writing a component lifecycle that supports stringify, hydration, and update.

The repository also contains picard-decorator, a small Node.js tool that renders micro frontends into HTML produced by something other than a Node.js server. It runs as an HTTP service or as a build step.

Examples in the Picard.js Repository ​

The Picard.js repository has more examples, which focus on individual features rather than on frameworks:

Released under the MIT License. Using an AI assistant? Point it to llms.txt.