Getting started
Next.js & SSR
ReactLoom renders on the server without browser globals. Layout, typography and Card work as React Server Components; interactive components ship with 'use client'.
App Router setup
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'.
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
systemtheme follows the OS before hydration. - Hydration produces no warnings; dialogs and forms work afterwards.