Skip to content

The Open Standard for Generative UI

docs: improve Lighthouse scores and add Lighthouse CI (#1410)

Zahle Khan3ffeffaa8e7d
diff --git a/.github/workflows/lighthouse.yml b/.github/workflows/lighthouse.yml
new file mode 100644
index 000000000..32901f589
--- /dev/null
+++ b/.github/workflows/lighthouse.yml
@@ -0,0 +1,85 @@
+name: Lighthouse
+
+on:
+ push:
+ branches: [main]
+ paths:
+ - "docs/**"
+ - "packages/**"
+ - "pnpm-lock.yaml"
+ - "pnpm-workspace.yaml"
+ - ".github/workflows/lighthouse.yml"
+ pull_request:
+ branches: [main]
+ paths:
+ - "docs/**"
+ - "packages/**"
+ - "pnpm-lock.yaml"
+ - "pnpm-workspace.yaml"
+ - ".github/workflows/lighthouse.yml"
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+concurrency:
+ group: lighthouse-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ lighthouse:
+ # Mobile and desktop run as separate jobs so the two passes over every page
+ # happen in parallel; each job builds the site itself.
+ name: Lighthouse (${{ matrix.form-factor }})
+ runs-on: ubuntu-latest
+ timeout-minutes: 60
+ strategy:
+ fail-fast: false
+ matrix:
+ form-factor: [mobile, desktop]
+ steps:
+ - uses: actions/checkout@v4
+ - uses: pnpm/action-setup@v6
+ - uses: actions/setup-node@v4
+ with:
+ node-version: v24.21.0
+ cache: pnpm
+ cache-dependency-path: "pnpm-lock.yaml"
+
+ - name: Install dependencies
+ run: pnpm install --frozen-lockfile
+
+ - name: Build workspace packages the docs site uses
+ run: pnpm --filter "@openuidev/docs^..." --workspace-concurrency=1 run build
+ env:
+ NODE_OPTIONS: --max-old-space-size=6144
+
+ - name: Build docs site
+ working-directory: docs
+ run: pnpm build
+ env:
+ NODE_OPTIONS: --max-old-space-size=6144
+ NEXT_TELEMETRY_DISABLED: "1"
+
+ # Serves the production build with `next start` and audits the pages in
+ # docs/lighthouserc.cjs. Accessibility, best practices and SEO fail the
+ # job when they drop below their floor; performance only warns.
+ - name: Lighthouse
+ working-directory: docs
+ run: npx --yes @lhci/[email protected] autorun
+ env:
+ LHCI_FORM_FACTOR: ${{ matrix.form-factor }}
+
+ - name: Summarize scores
+ if: ${{ !cancelled() }}
+ working-directory: docs
+ run: node scripts/lighthouse-summary.mjs >> "$GITHUB_STEP_SUMMARY"
+
+ - name: Upload reports
+ if: ${{ !cancelled() }}
+ uses: actions/upload-artifact@v4
+ with:
+ name: lighthouse-reports-${{ matrix.form-factor }}
+ path: docs/lighthouse-reports
+ if-no-files-found: ignore
+ retention-days: 14
diff --git a/docs/.gitignore b/docs/.gitignore
index d5787163e..6be8078df 100644
--- a/docs/.gitignore
+++ b/docs/.gitignore
@@ -7,6 +7,8 @@
# test & build
/coverage
+/.lighthouseci/
+/lighthouse-reports/
/.next/
/out/
/build
diff --git a/docs/app/(home)/benchmarks/BenchmarksContent.tsx b/docs/app/(home)/benchmarks/BenchmarksContent.tsx
index 452725251..e83f11e5c 100644
--- a/docs/app/(home)/benchmarks/BenchmarksContent.tsx
+++ b/docs/app/(home)/benchmarks/BenchmarksContent.tsx
@@ -353,7 +353,7 @@ export function BenchmarksContent() {
href: "https://console.thesys.dev/keys",
external: true,
}}
- secondary={{ label: "Learn more", href: "/cloud/gateway" }}
+ secondary={{ label: "Explore Gateway", href: "/cloud/gateway" }}
/>
</VizSkin>
</main>
diff --git a/docs/app/(home)/components/FadedDither/FadedDither.module.css b/docs/app/(home)/components/FadedDither/FadedDither.module.css
new file mode 100644
index 000000000..53bfe5a2b
--- /dev/null
+++ b/docs/app/(home)/components/FadedDither/FadedDither.module.css
@@ -0,0 +1,29 @@
+/* Both layers fill the wrapper, which the caller positions. The live canvas is
+ positioned too, so it paints over the still in source order. */
+.still,
+.live {
+ position: absolute;
+ inset: 0;
+}
+
+.still img {
+ display: block;
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+}
+
+.live {
+ opacity: 0;
+ transition: opacity 600ms ease;
+}
+
+.liveReady {
+ opacity: 1;
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .live {
+ transition: none;
+ }
+}
diff --git a/docs/app/(home)/components/FadedDither/FadedDither.tsx b/docs/app/(home)/components/FadedDither/FadedDither.tsx
index d07178daa..7b9367191 100644
--- a/docs/app/(home)/components/FadedDither/FadedDither.tsx
+++ b/docs/app/(home)/components/FadedDither/FadedDither.tsx
@@ -1,7 +1,8 @@
"use client";
import dynamic from "next/dynamic";
-import { type CSSProperties, useEffect, useState } from "react";
+import { type CSSProperties, type RefObject, useEffect, useRef, useState } from "react";
+import styles from "./FadedDither.module.css";
/* WebGPU only exists in the browser, so the canvas is loaded on the client and
never rendered on the server. Use this rather than FadedDitherCanvas. */
@@ -10,11 +11,64 @@ const FadedDitherCanvas = dynamic(
{ ssr: false },
);
+/* The shader library is about 3 MB of JavaScript, and the texture it paints is
+ decoration over a stage that reads fine without it. So it is only fetched
+ where it can draw (WebGPU), once the stage is near the viewport, and when the
+ main thread is idle, keeping it off the page's critical path. */
+function useDeferredShader(ref: RefObject<HTMLElement | null>) {
+ const [ready, setReady] = useState(false);
+
+ useEffect(() => {
+ const element = ref.current;
+ if (!element || !("gpu" in navigator)) return;
+
+ let cancelIdle: (() => void) | undefined;
+ const observer = new IntersectionObserver(
+ (entries) => {
+ if (!entries.some((entry) => entry.isIntersecting)) return;
+ observer.disconnect();
+ if (typeof window.requestIdleCallback === "function") {
+ const id = window.requestIdleCallback(() => setReady(true), { timeout: 3_000 });
+ cancelIdle = () => window.cancelIdleCallback(id);
+ } else {
+ const id = setTimeout(() => setReady(true), 200);
+ cancelIdle = () => clearTimeout(id);
+ }
+ },
+ { rootMargin: "200px" },
+ );
+ observer.observe(element);
+
+ return () => {
+ observer.disconnect();
+ cancelIdle?.();
+ };
+ }, [ref]);
+
+ return ready;
+}
+
/* The same breakpoint the stages use. The wave follows the viewport, not the
canvas: a stage can be half a wide page and still wants the page's wave, so
that every shader on a given screen reads as the same material. */
const COMPACT_QUERY = "(max-width: 767px)";
+/* Stills of the shader, smoothed, one per tone and width mode. One shows as soon
+ as the page renders and stays underneath; the live canvas fades in over it on
+ its first frame, so the texture never pops in from a flat fill. Browsers
+ without WebGPU keep the still. Regenerate them whenever TONES or WAVE in
+ FadedDitherCanvas.tsx change. */
+const STILLS = {
+ light: {
+ wide: "/shaders/faded-dither-light-wide.webp",
+ compact: "/shaders/faded-dither-light-compact.webp",
+ },
+ dark: {
+ wide: "/shaders/faded-dither-dark-wide.webp",
+ compact: "/shaders/faded-dither-dark-compact.webp",
+ },
+} as const;
+
/* The page theme, watched rather than read once: the site can change it after
mount, and this component has to follow. */
function usePageTheme() {
@@ -48,6 +102,9 @@ export function FadedDither({
style?: CSSProperties;
}) {
const theme = usePageTheme();
+ const rootRef = useRef<HTMLDivElement>(null);
+ const showShader = useDeferredShader(rootRef);
+ const [shaderReady, setShaderReady] = useState(false);
const [compact, setCompact] = useState(false);
useEffect(() => {
@@ -66,8 +123,27 @@ export function FadedDither({
mode in the DOM, where they can be read without going through React
internals, which double-buffer and will hand back a stale tree. */
return (
- <div className={className} data-compact={compact || undefined} data-tone={tone} style={style}>
- <FadedDitherCanvas compact={compact} tone={tone} />
+ <div
+ ref={rootRef}
+ className={className}
+ data-compact={compact || undefined}
+ data-tone={tone}
+ style={style}
+ >
+ {/* The still picks its width mode by media query rather than from
+ `compact`, so it is already right before hydration. */}
+ <picture className={styles.still}>
+ <source media={COMPACT_QUERY} srcSet={STILLS[tone].compact} />
+ <img src={STILLS[tone].wide} alt="" loading="lazy" decoding="async" />
+ </picture>
+ {showShader && (
+ <FadedDitherCanvas
+ className={`${styles.live} ${shaderReady ? styles.liveReady : ""}`.trim()}
+ compact={compact}
+ onReady={() => setShaderReady(true)}
+ tone={tone}
+ />
+ )}
</div>
);
}
diff --git a/docs/app/(home)/components/FadedDither/FadedDitherCanvas.tsx b/docs/app/(home)/components/FadedDither/FadedDitherCanvas.tsx
index 0c34be150..e52b1fa8a 100644
--- a/docs/app/(home)/components/FadedDither/FadedDitherCanvas.tsx
+++ b/docs/app/(home)/components/FadedDither/FadedDitherCanvas.tsx
@@ -41,18 +41,21 @@ export function FadedDitherCanvas({
compact = false,
className,
style,
+ onReady,
}: {
tone?: keyof typeof TONES;
/* Set when the viewport is phone width. */
compact?: boolean;
className?: string;
style?: CSSProperties;
+ /* Called once the first frame has been drawn. */
+ onReady?: () => void;
}) {
const { base, stipple } = TONES[tone];
const wave = WAVE[compact ? "compact" : "wide"];
return (
- <Shader className={className} style={style}>
+ <Shader className={className} style={style} onReady={onReady}>
<SolidColor color={base} />
<Dither colorB={stipple} pattern="bayer8" threshold={0.41}>
<SineWave
diff --git a/docs/app/(home)/integrations/data.ts b/docs/app/(home)/integrations/data.ts
index 9f2bbe1c2..7e050112c 100644
--- a/docs/app/(home)/integrations/data.ts
+++ b/docs/app/(home)/integrations/data.ts
@@ -478,7 +478,7 @@ const integrationCatalog: Integration[] = [
slug: "grok-build",
name: "Grok Build",
seoTitle: "Grok Build generative UI with OpenUI",
- logo: "https://media.x.ai/v1/website/spacexai-symbol-black-transparent-6435cf42.png",
+ logo: "/brand-icons/xai.svg",
category: "ai-frameworks",
type: "Coding agent",
summary:
diff --git a/docs/app/(home)/layout.tsx b/docs/app/(home)/layout.tsx
index a77e60164..8222112b7 100644
--- a/docs/app/(home)/layout.tsx
+++ b/docs/app/(home)/layout.tsx
@@ -1,15 +1,15 @@
-import { WebsiteThemeProvider } from "@/components/website-theme-provider";
+import { MarketingThemeProvider } from "@/components/marketing-theme-provider";
import "./globals.css";
import { Navbar } from "./sections/Navbar/Navbar";
export default function Layout({ children }: { children: React.ReactNode }) {
return (
- <WebsiteThemeProvider>
+ <MarketingThemeProvider>
{process.env.NODE_ENV === "development" ? (
<script src="https://mcp.figma.com/mcp/html-to-design/capture.js" async />
) : null}
<Navbar />
<div className="homeTheme">{children}</div>
- </WebsiteThemeProvider>
+ </MarketingThemeProvider>
);
}
diff --git a/docs/app/(home)/sections/HeroSection/HeroSection.module.css b/docs/app/(home)/sections/HeroSection/HeroSection.module.css
index 89e214a16..d08ab4e73 100644
--- a/docs/app/(home)/sections/HeroSection/HeroSection.module.css
+++ b/docs/app/(home)/sections/HeroSection/HeroSection.module.css
@@ -1058,6 +1058,12 @@
mask-image: linear-gradient(to right, #000 0%, #000 40%, transparent 64%);
}
+/* The <picture> only chooses the source; the image lays out as if it were the
+ container's own child. */
+.heroPicture {
+ display: contents;
+}
+
.mobileIllustrationImage,
.previewImage {
display: block;
diff --git a/docs/app/(home)/sections/HeroSection/HeroSection.tsx b/docs/app/(home)/sections/HeroSection/HeroSection.tsx
index 69fc85b13..d20d80a2b 100644
--- a/docs/app/(home)/sections/HeroSection/HeroSection.tsx
+++ b/docs/app/(home)/sections/HeroSection/HeroSection.tsx
@@ -64,6 +64,20 @@ const MOBILE_HERO_IMAGE = {
} as const;
type HeroTheme = "light" | "dark";
+
+/* Both hero images are in the markup and CSS shows one per breakpoint, but an
+ <img> under display:none still downloads. Each one sits in a <picture> whose
+ <source> swaps in this inline blank wherever its layout is hidden, so a phone
+ never fetches the desktop shot and a desktop never fetches the phone one.
+ These widths must match the breakpoints in HeroSection.module.css. */
+const BLANK_IMAGE =
+ "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
+const DESKTOP_MIN_WIDTH = 1024;
+const DESKTOP_FROM_TABLET_MIN_WIDTH = 900;
+
+function desktopMinWidth(desktopFromTablet: boolean) {
+ return desktopFromTablet ? DESKTOP_FROM_TABLET_MIN_WIDTH : DESKTOP_MIN_WIDTH;
+}
// ---------------------------------------------------------------------------
// Buttons
// ---------------------------------------------------------------------------
@@ -444,6 +458,7 @@ function MobileHero({
mobileImageCropTopPercent = 0,
mobilePreviewSlot,
showPreview,
+ desktopFromTablet,
}: {
theme: HeroTheme;
title: ReactNode;
@@ -469,6 +484,7 @@ function MobileHero({
mobileImageCropTopPercent?: number;
mobilePreviewSlot?: ReactNode;
showPreview: boolean;
+ desktopFromTablet: boolean;
}) {
const [platform, setPlatform] = useState<CommandPlatform>("macos");
const activeCommand = platform === "windows" && secondaryCommand ? secondaryCommand : command;
@@ -552,17 +568,23 @@ function MobileHero({
style={viewportStyle}
>
{mobilePreviewSlot ?? (
- <img
- src={mobileHeroImage}
- alt={mobileImageAlt ?? "OpenUI mobile hero preview"}
- width={naturalWidth}
- height={naturalHeight}
- className={styles.mobileIllustrationImage}
- style={imageStyle}
- loading="eager"
- decoding="async"
- fetchPriority="high"
- />
+ <picture className={styles.heroPicture}>
+ <source
+ media={`(min-width: ${desktopMinWidth(desktopFromTablet)}px)`}
+ srcSet={BLANK_IMAGE}
+ />
+ <img
+ src={mobileHeroImage}
+ alt={mobileImageAlt ?? "OpenUI mobile hero preview"}
+ width={naturalWidth}
+ height={naturalHeight}
+ className={styles.mobileIllustrationImage}
+ style={imageStyle}
+ loading="eager"
+ decoding="async"
+ fetchPriority="high"
+ />
+ </picture>
)}
</div>
)}
@@ -583,6 +605,7 @@ function PreviewImage({
desktopImageHeight,
widePreview,
desktopPreviewSlot,
+ desktopFromTablet,
}: {
theme: HeroTheme;
desktopImageOverride?: string;
@@ -592,6 +615,7 @@ function PreviewImage({
desktopImageHeight?: number;
widePreview?: boolean;
desktopPreviewSlot?: ReactNode;
+ desktopFromTablet: boolean;
}) {
const desktopHeroImage = desktopImageOverride
? theme === "dark"
@@ -612,16 +636,22 @@ function PreviewImage({
} ${desktopPreviewSlot ? styles.previewFrameSlot : ""}`.trim()}
>
{desktopPreviewSlot ?? (
- <img
- src={desktopHeroImage}
- alt={desktopImageAlt ?? "OpenUI desktop hero preview"}
- width={desktopImageWidth ?? DESKTOP_HERO_IMAGE.width}
- height={desktopImageHeight ?? DESKTOP_HERO_IMAGE.height}
- className={styles.previewImage}
- loading="eager"
- decoding="async"
- fetchPriority="high"
- />
+ <picture className={styles.heroPicture}>
+ <source
+ media={`(max-width: ${desktopMinWidth(desktopFromTablet) - 1}px)`}
+ srcSet={BLANK_IMAGE}
+ />
+ <img
+ src={desktopHeroImage}
+ alt={desktopImageAlt ?? "OpenUI desktop hero preview"}
+ width={desktopImageWidth ?? DESKTOP_HERO_IMAGE.width}
+ height={desktopImageHeight ?? DESKTOP_HERO_IMAGE.height}
+ className={styles.previewImage}
+ loading="eager"
+ decoding="async"
+ fetchPriority="high"
+ />
+ </picture>
)}
</div>
</div>
@@ -805,6 +835,7 @@ export function HeroSection({
mobileImageCropTopPercent={mobilePreviewImageCropTopPercent}
mobilePreviewSlot={mobilePreviewSlot}
showPreview={showPreview}
+ desktopFromTablet={desktopFromTablet}
/>
{showPreview && (
<PreviewImage
@@ -816,6 +847,7 @@ export function HeroSection({
desktopImageHeight={desktopPreviewImageHeight}
widePreview={widePreview}
desktopPreviewSlot={desktopPreviewSlot}
+ desktopFromTablet={desktopFromTablet}
/>
)}
{showTagline && <Tagline compact={taglineCompact}>{tagline}</Tagline>}
diff --git a/docs/app/(home)/sections/ProductSection/ProductSection.tsx b/docs/app/(home)/sections/ProductSection/ProductSection.tsx
index d7c1c8fe2..0db877c3e 100644
--- a/docs/app/(home)/sections/ProductSection/ProductSection.tsx
+++ b/docs/app/(home)/sections/ProductSection/ProductSection.tsx
@@ -10,6 +10,12 @@ import { FadedDither } from "../../components/FadedDither/FadedDither";
import { FeatureGridSection, type GridFeatureIcon } from "../FeatureGridSection/FeatureGridSection";
import styles from "./ProductSection.module.css";
+/* Rendered widths of the stage artwork, so phones fetch a phone-sized file
+ rather than the 2x desktop one. The wide shot shows from 768px up, capped at
+ --home-container-max; the compact one fills the band minus its gutters. */
+const STAGE_WIDE_SIZES = "(max-width: 1023px) calc(100vw - 80px), 1200px";
+const STAGE_COMPACT_SIZES = "calc(100vw - 40px)";
+
export type ProductCard = {
Icon: Icon;
/* The same icon named as a string. The phone layout hands these cards to
@@ -171,6 +177,7 @@ export function ProductSection({
width={1280}
height={720}
loading="lazy"
+ sizes={STAGE_WIDE_SIZES}
/>
<Image
className={`${styles.stageImage} ${styles.stageDark}`}
@@ -180,6 +187,7 @@ export function ProductSection({
width={1280}
height={720}
loading="lazy"
+ sizes={STAGE_WIDE_SIZES}
/>
</span>
<span className={styles.stageCompact}>
@@ -191,6 +199,7 @@ export function ProductSection({
width={720}
height={600}
loading="lazy"
+ sizes={STAGE_COMPACT_SIZES}
/>
<Image
className={`${styles.stageImage} ${styles.stageDark}`}
@@ -200,6 +209,7 @@ export function ProductSection({
width={720}
height={600}
loading="lazy"
+ sizes={STAGE_COMPACT_SIZES}
/>
</span>
</>
diff --git a/docs/app/(home)/sections/ProductSection/products.ts b/docs/app/(home)/sections/ProductSection/products.ts
index 86b496e86..61c33b757 100644
--- a/docs/app/(home)/sections/ProductSection/products.ts
+++ b/docs/app/(home)/sections/ProductSection/products.ts
@@ -67,7 +67,7 @@ export const GATEWAY_PRODUCT: ProductSectionProps = {
href: "https://console.thesys.dev/keys",
external: true,
},
- secondaryCta: { label: "Learn more", href: "/cloud/gateway" },
+ secondaryCta: { label: "Explore Gateway", href: "/cloud/gateway" },
tone: "dark",
shot: "/homepage/gateway",
fullBleedArt: true,
diff --git a/docs/app/global.css b/docs/app/global.css
index 825ff8ba1..4b29383b4 100644
--- a/docs/app/global.css
+++ b/docs/app/global.css
@@ -1,4 +1,3 @@
-@import url("https://fonts.googleapis.com/css2?family=Playwrite+US+Trad&family=Geist:wght@400;500;600;700&display=swap");
@import "tailwindcss";
@import "fumadocs-ui/css/neutral.css";
@import "fumadocs-ui/css/preset.css";
diff --git a/docs/app/layout.tsx b/docs/app/layout.tsx
index 4b6b44f44..4d7d6b459 100644
--- a/docs/app/layout.tsx
+++ b/docs/app/layout.tsx
@@ -1,6 +1,6 @@
import { RootProvider } from "fumadocs-ui/provider/next";
import type { Metadata } from "next";
-import { Geist_Mono, Inter } from "next/font/google";
+import { Geist, Geist_Mono, Inter } from "next/font/google";
import Script from "next/script";
import { SITE_NAME, SITE_OPEN_GRAPH } from "../lib/page-metadata";
import { BASE_URL } from "../lib/source";
@@ -11,6 +11,14 @@ const inter = Inter({
subsets: ["latin"],
});
+// Only the OpenUI wordmark uses Geist, so it is not preloaded ahead of the
+// fonts and images the first paint actually needs.
+const geist = Geist({
+ variable: "--font-geist",
+ subsets: ["latin"],
+ preload: false,
+});
+
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
@@ -70,7 +78,7 @@ export default function Layout({ children }: LayoutProps<"/">) {
return (
<html
lang="en"
- className={`${inter.className} ${geistMono.variable}`}
+ className={`${inter.className} ${geist.variable} ${geistMono.variable}`}
// Lets Next.js skip smooth scrolling on route changes; in-page anchors still scroll smoothly.
data-scroll-behavior="smooth"
suppressHydrationWarning
diff --git a/docs/app/providers.tsx b/docs/app/providers.tsx
index ee2dbb2ab..0c1d0f549 100644
--- a/docs/app/providers.tsx
+++ b/docs/app/providers.tsx
@@ -4,23 +4,11 @@ import { loadPostHog } from "@/lib/analytics";
import { addThesysLinkAttribution } from "@/lib/thesys-link-attribution";
import { useEffect } from "react";
-let reoPromise: Promise<void> | undefined;
-
export function PHProvider({ children }: { children: React.ReactNode }) {
useEffect(() => {
let posthogDistinctId: string | undefined;
let posthogSessionId: string | undefined;
- const clientID = process.env.NEXT_PUBLIC_REO_CLIENT_ID?.trim();
- if (clientID) {
- reoPromise ??=
- // @ts-expect-error reodotdev does not publish TypeScript declarations.
- import("reodotdev")
- .then(({ loadReoScript }) => loadReoScript({ clientID }))
- .then((reo: { init(config: { clientID: string }): void }) => reo.init({ clientID }))
- .catch(() => {});
- }
-
const load = () => {
void loadPostHog()
.then((posthog) => {
diff --git a/docs/components/brand-logo.tsx b/docs/components/brand-logo.tsx
index 812ca57c7..d351b946f 100644
--- a/docs/components/brand-logo.tsx
+++ b/docs/components/brand-logo.tsx
@@ -86,8 +86,8 @@ export function ThesysLogo({
export function OpenUILogo({ variant = "light" }: { variant?: LogoVariant }) {
const isDark = variant === "dark";
const textClass = isDark
- ? "font-['Geist',sans-serif] font-semibold text-[15px] text-white leading-6"
- : "font-['Geist',sans-serif] font-semibold text-[15px] text-black leading-6";
+ ? "font-[family-name:var(--font-geist),sans-serif] font-semibold text-[15px] text-white leading-6"
+ : "font-[family-name:var(--font-geist),sans-serif] font-semibold text-[15px] text-black leading-6";
return (
<Link href="/" className="flex items-center gap-0.5 no-underline">
diff --git a/docs/components/marketing-theme-provider.tsx b/docs/components/marketing-theme-provider.tsx
new file mode 100644
index 000000000..913d31dac
--- /dev/null
+++ b/docs/components/marketing-theme-provider.tsx
@@ -0,0 +1,17 @@
+"use client";
+
+// The subpath entry is only the provider. The package root would put the whole
+// component library (~2 MB of JS) into every marketing page's first load. The
+// catch is that it has its own React context, so @openuidev/react-ui components
+// rendered below it would not see this theme. Use WebsiteThemeProvider for any
+// page that renders them.
+import { ThemeProvider } from "@openuidev/react-ui/ThemeProvider";
+import { WebsiteThemeBridge, type WebsiteThemeProviderProps } from "./website-theme-bridge";
+
+export function MarketingThemeProvider({ children, forcedTheme }: WebsiteThemeProviderProps) {
+ return (
+ <WebsiteThemeBridge provider={ThemeProvider} forcedTheme={forcedTheme}>
+ {children}
+ </WebsiteThemeBridge>
+ );
+}
diff --git a/docs/components/website-theme-bridge.tsx b/docs/components/website-theme-bridge.tsx
new file mode 100644
index 000000000..6179fd310
--- /dev/null
+++ b/docs/components/website-theme-bridge.tsx
@@ -0,0 +1,69 @@
+"use client";
+
+import { useTheme } from "next-themes";
+import { useEffect, type ComponentType, type ReactNode } from "react";
+
+const FONT_FAMILY = 'var(--font-inter), "Inter", "Segoe UI", Arial, sans-serif';
+const FONT_CODE = 'var(--font-geist-mono), "SFMono-Regular", Menlo, monospace';
+
+const fontOverrides = {
+ fontBody: FONT_FAMILY,
+ fontCode: FONT_CODE,
+ fontHeading: FONT_FAMILY,
+ fontLabel: FONT_FAMILY,
+ fontNumbers: FONT_FAMILY,
+};
+
+export type WebsiteThemeProviderProps = {
+ children: ReactNode;
+ forcedTheme?: "light" | "dark";
+};
+
+type ThemeProviderComponent = ComponentType<{
+ mode: "light" | "dark";
+ lightTheme: typeof fontOverrides;
+ children: ReactNode;
+}>;
+
+export function WebsiteThemeBridge({
+ children,
+ forcedTheme,
+ provider: Provider,
+}: WebsiteThemeProviderProps & { provider: ThemeProviderComponent }) {
+ const { resolvedTheme } = useTheme();
+ const mode = forcedTheme ?? (resolvedTheme === "dark" ? "dark" : "light");
+
+ useEffect(() => {
+ const root = document.documentElement;
+ const body = document.body;
+ const previousRootTheme = root.getAttribute("data-theme");
+ const previousBodyTheme = body.getAttribute("data-theme");
+ const previousColorScheme = root.style.colorScheme;
+
+ root.setAttribute("data-theme", mode);
+ body.setAttribute("data-theme", mode);
+ root.style.colorScheme = mode;
+
+ return () => {
+ if (previousRootTheme === null) {
+ root.removeAttribute("data-theme");
+ } else {
+ root.setAttribute("data-theme", previousRootTheme);
+ }
+
+ if (previousBodyTheme === null) {
+ body.removeAttribute("data-theme");
+ } else {
+ body.setAttribute("data-theme", previousBodyTheme);
+ }
+
+ root.style.colorScheme = previousColorScheme;
+ };
+ }, [mode]);
+
+ return (
+ <Provider mode={mode} lightTheme={fontOverrides}>
+ {children}
+ </Provider>
+ );
+}
diff --git a/docs/components/website-theme-provider.tsx b/docs/components/website-theme-provider.tsx
index af7ce01cf..0916f6a2e 100644
--- a/docs/components/website-theme-provider.tsx
+++ b/docs/components/website-theme-provider.tsx
@@ -1,70 +1,12 @@
"use client";
import { ThemeProvider } from "@openuidev/react-ui";
-import { useTheme } from "next-themes";
-import { useEffect, type ReactNode } from "react";
-
-const FONT_FAMILY = 'var(--font-inter), "Inter", "Segoe UI", Arial, sans-serif';
-const FONT_CODE = 'var(--font-geist-mono), "SFMono-Regular", Menlo, monospace';
-
-const fontOverrides = {
- fontBody: FONT_FAMILY,
- fontCode: FONT_CODE,
- fontHeading: FONT_FAMILY,
- fontLabel: FONT_FAMILY,
- fontNumbers: FONT_FAMILY,
-};
-
-type WebsiteThemeProviderProps = {
- children: ReactNode;
- forcedTheme?: "light" | "dark";
-};
-
-function WebsiteThemeBridge({
- children,
- forcedTheme,
-}: {
- children: ReactNode;
- forcedTheme?: "light" | "dark";
-}) {
- const { resolvedTheme } = useTheme();
- const mode = forcedTheme ?? (resolvedTheme === "dark" ? "dark" : "light");
-
- useEffect(() => {
- const root = document.documentElement;
- const body = document.body;
- const previousRootTheme = root.getAttribute("data-theme");
- const previousBodyTheme = body.getAttribute("data-theme");
- const previousColorScheme = root.style.colorScheme;
-
- root.setAttribute("data-theme", mode);
- body.setAttribute("data-theme", mode);
- root.style.colorScheme = mode;
-
- return () => {
- if (previousRootTheme === null) {
- root.removeAttribute("data-theme");
- } else {
- root.setAttribute("data-theme", previousRootTheme);
- }
-
- if (previousBodyTheme === null) {
- body.removeAttribute("data-theme");
- } else {
- body.setAttribute("data-theme", previousBodyTheme);
- }
-
- root.style.colorScheme = previousColorScheme;
- };
- }, [mode]);
+import { WebsiteThemeBridge, type WebsiteThemeProviderProps } from "./website-theme-bridge";
+export function WebsiteThemeProvider({ children, forcedTheme }: WebsiteThemeProviderProps) {
return (
- <ThemeProvider mode={mode} lightTheme={fontOverrides}>
+ <WebsiteThemeBridge provider={ThemeProvider} forcedTheme={forcedTheme}>
{children}
- </ThemeProvider>
+ </WebsiteThemeBridge>
);
}
-
-export function WebsiteThemeProvider({ children, forcedTheme }: WebsiteThemeProviderProps) {
- return <WebsiteThemeBridge forcedTheme={forcedTheme}>{children}</WebsiteThemeBridge>;
-}
diff --git a/docs/lib/examples-catalog.ts b/docs/lib/examples-catalog.ts
index d125542fb..ac258e114 100644
--- a/docs/lib/examples-catalog.ts
+++ b/docs/lib/examples-catalog.ts
@@ -39,8 +39,7 @@ const EXAMPLE_LOGOS: Record<string, string> = {
"app-frameworks/vue": "/integration-logos/vue.svg",
"design-systems/material-ui": "/integration-logos/mui.svg",
"design-systems/shadcn": "/integration-logos/shadcn-ui.svg",
- "harnesses/grok-build":
- "https://media.x.ai/v1/website/spacexai-symbol-black-transparent-6435cf42.png",
+ "harnesses/grok-build": "/brand-icons/xai.svg",
"harnesses/pi": "/integration-logos/pi.svg",
"miscellaneous/autofix": "/favicon.svg",
"miscellaneous/handsontable":
diff --git a/docs/lighthouserc.cjs b/docs/lighthouserc.cjs
new file mode 100644
index 000000000..05ce816f7
--- /dev/null
+++ b/docs/lighthouserc.cjs
@@ -0,0 +1,64 @@
+// Lighthouse CI for the docs site. Run from this directory after `pnpm build`:
+//
+// LHCI_FORM_FACTOR=mobile npx @lhci/[email protected] autorun
+//
+// LHCI_FORM_FACTOR picks the profile (mobile, the default, or desktop). Each run
+// starts `next start`, audits the pages below, and writes reports to
+// lighthouse-reports/<form factor>/. .github/workflows/lighthouse.yml runs both,
+// as parallel jobs.
+
+const PORT = 4317;
+const formFactor = process.env.LHCI_FORM_FACTOR === "desktop" ? "desktop" : "mobile";
+
+// The ten most-visited paths on openui.com (site analytics, October 2026).
+// Revisit when traffic shifts.
+const PAGES = [
+ "/",
+ "/blog/how-chatgpt-intelligent-ui-works",
+ "/docs",
+ "/docs/openui-lang",
+ "/chat",
+ "/benchmarks",
+ "/cloud/gateway",
+ "/demo/github",
+ "/openui-vs-json",
+ "/demos",
+];
+
+// Performance swings a lot between CI runners, so it only warns, and the floor
+// sits just under today's scores (mobile 52-72, desktop 89-97) to flag real
+// drops. The other categories are deterministic enough to fail the check.
+const performanceFloor = formFactor === "desktop" ? 0.85 : 0.5;
+
+module.exports = {
+ ci: {
+ collect: {
+ startServerCommand: `pnpm exec next start -p ${PORT}`,
+ startServerReadyPattern: "Ready in",
+ url: PAGES.map((path) => `http://localhost:${PORT}${path}`),
+ numberOfRuns: 3,
+ settings: {
+ ...(formFactor === "desktop" ? { preset: "desktop" } : {}),
+ // GitHub-hosted runners have no sandbox-capable user namespace.
+ chromeFlags: "--no-sandbox --headless=new",
+ },
+ },
+ assert: {
+ assertions: {
+ "categories:performance": [
+ "warn",
+ { minScore: performanceFloor, aggregationMethod: "median-run" },
+ ],
+ // Just under today's lowest page (the home page, 84). Raise it as the
+ // accessibility issues Lighthouse reports get fixed.
+ "categories:accessibility": ["error", { minScore: 0.8, aggregationMethod: "median-run" }],
+ "categories:best-practices": ["error", { minScore: 0.95, aggregationMethod: "median-run" }],
+ "categories:seo": ["error", { minScore: 0.95, aggregationMethod: "median-run" }],
+ },
+ },
+ upload: {
+ target: "filesystem",
+ outputDir: `lighthouse-reports/${formFactor}`,
+ },
+ },
+};
diff --git a/docs/package.json b/docs/package.json
index 048bf6b35..1158dfa72 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -49,7 +49,6 @@
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react-resizable-panels": "^4.12.2",
- "reodotdev": "^1.1.0",
"semver": "^7.8.5",
"shaders": "^3.2.470",
"tailwind-merge": "^3.4.1",
diff --git a/docs/public/shaders/faded-dither-dark-compact.webp b/docs/public/shaders/faded-dither-dark-compact.webp
new file mode 100644
index 000000000..b31b133f2
Binary files /dev/null and b/docs/public/shaders/faded-dither-dark-compact.webp differ
diff --git a/docs/public/shaders/faded-dither-dark-wide.webp b/docs/public/shaders/faded-dither-dark-wide.webp
new file mode 100644
index 000000000..85de0fed9
Binary files /dev/null and b/docs/public/shaders/faded-dither-dark-wide.webp differ
diff --git a/docs/public/shaders/faded-dither-light-compact.webp b/docs/public/shaders/faded-dither-light-compact.webp
new file mode 100644
index 000000000..b071e3c57
Binary files /dev/null and b/docs/public/shaders/faded-dither-light-compact.webp differ
diff --git a/docs/public/shaders/faded-dither-light-wide.webp b/docs/public/shaders/faded-dither-light-wide.webp
new file mode 100644
index 000000000..e033e45a4
Binary files /dev/null and b/docs/public/shaders/faded-dither-light-wide.webp differ
diff --git a/docs/scripts/lighthouse-summary.mjs b/docs/scripts/lighthouse-summary.mjs
new file mode 100644
index 000000000..878e1f732
--- /dev/null
+++ b/docs/scripts/lighthouse-summary.mjs
@@ -0,0 +1,47 @@
+// Prints the Lighthouse CI scores in lighthouse-reports/<form factor>/ as a
+// Markdown table, one row per page and form factor. CI appends it to the job
+// summary; locally it just prints.
+//
+// node scripts/lighthouse-summary.mjs [reports dir]
+
+import { existsSync, readdirSync, readFileSync } from "node:fs";
+import { join } from "node:path";
+
+const reportsDir = process.argv[2] ?? "lighthouse-reports";
+const CATEGORIES = [
+ ["performance", "Performance"],
+ ["accessibility", "Accessibility"],
+ ["best-practices", "Best practices"],
+ ["seo", "SEO"],
+];
+
+function badge(score) {
+ if (typeof score !== "number") return "–";
+ const value = Math.round(score * 100);
+ const mark = value >= 90 ? "🟢" : value >= 50 ? "🟠" : "🔴";
+ return `${mark} ${value}`;
+}
+
+const rows = [];
+for (const formFactor of existsSync(reportsDir) ? readdirSync(reportsDir).sort() : []) {
+ const manifestPath = join(reportsDir, formFactor, "manifest.json");
+ if (!existsSync(manifestPath)) continue;
+
+ const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
+ // LHCI marks the median run for each URL as the representative one.
+ for (const run of manifest.filter((entry) => entry.isRepresentativeRun)) {
+ const path = new URL(run.url).pathname;
+ const scores = CATEGORIES.map(([id]) => badge(run.summary[id]));
+ rows.push(`| \`${path}\` | ${formFactor} | ${scores.join(" | ")} |`);
+ }
+}
+
+if (rows.length === 0) {
+ console.log(`No Lighthouse reports found in ${reportsDir}.`);
+} else {
+ console.log("### Lighthouse scores\n");
+ console.log(`| Page | Device | ${CATEGORIES.map(([, label]) => label).join(" | ")} |`);
+ console.log(`| --- | --- | ${CATEGORIES.map(() => "---").join(" | ")} |`);
+ console.log(rows.join("\n"));
+ console.log("\nMedian of three runs per page. Full HTML reports are in the workflow artifacts.");
+}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index d5ee5c064..366067680 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -234,9 +234,6 @@ importers:
react-resizable-panels:
specifier: ^4.12.2
- reodotdev:
- specifier: ^1.1.0
- version: 1.1.0
semver:
specifier: ^7.8.5
version: 7.8.5
@@ -9828,13 +9825,6 @@ packages:
resolution: {integrity: sha512-Eht5w30ruCXgFmxVUSlNWQ9iiimq07URKeFS3hNc8cUWy1llX4KDWfyEDZRycMc+znsN9Ux5/tJ/BFdgdOwA3A==}
- resolution: {integrity: sha512-QPnAyRk6gUK9h2XJy9yTXiA91+LEHahmzbRdfb6DigAoe1S/nKg2LXc+/m3//HGyMPAkCFVz/FJJ8YrKm5IrXw==}
- engines: {node: '>=12.0.0'}
-
- resolution: {integrity: sha512-BeIlYk59p4Gw+zPHJj249xPBQ0wHfI8NsksVFRTdPLkPXDSYyn6IBvbR0s7pELK9qk3p79UBcBWP84IsYLsvbg==}
-
resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
engines: {node: '>=0.10.0'}
@@ -20759,12 +20749,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
-
- dependencies:
- reo-census: 1.2.9
-