App Router setup

app/layout.tsx
import '@reactloom/theme/theme.css';
import '@reactloom/ui/styles.css';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  // The attribute themes the server HTML before hydration: no flash, no mismatch.
  return (
    <html lang="en" data-pl-theme="system">
      <body>{children}</body>
    </html>
  );
}

No transpilePackages or plugins are needed.

Server and client components

  • Server-safe: Box, Stack, Grid, Container, Text, Heading, Link, Code, Lists, Card, Spinner.
  • Client: Button, Input and form controls, Dialog, ThemeProvider — already marked 'use client'.
app/page.tsx
import { Card, Heading, Stack } from '@reactloom/ui'; // rendered on the server
import { ProfileForm } from './profile-form';           // 'use client' inside

export default function Page() {
  return (
    <Stack gap="6">
      <Heading level={1}>Account</Heading>
      <Card><ProfileForm /></Card>
    </Stack>
  );
}

What is verified

The repository’s Next.js example is tested in a real browser on every change:

  • The server HTML is complete and styled with JavaScript disabled.
  • The system theme follows the OS before hydration.
  • Hydration produces no warnings; dialogs and forms work afterwards.