Reactberry Documentation
A docs site powered entirely by Reactberry itself.
overview
Install Reactberry and wire it into a Next.js app with the correct provider, Next config, and first component imports.
This guide shows the smallest useful setup for using Reactberry in a Next.js project.
styled-components 6+Install the current beta release of Reactberry and the styling dependency it expects.
npm install @reactberry/system@beta styled-components
If you prefer to pin the exact prerelease, install @reactberry/system@2.0.0-beta.2 instead.
@reactberry/system ships source files, so your Next app should transpile it.
In next.config.ts:
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
transpilePackages: ["@reactberry/system"],
};
export default nextConfig;
Use DesignSystemProvider in your root layout so Reactberry can register styled-components, provide the theme, and apply its global styles.
In app/layout.tsx:
import { DesignSystemProvider } from "@reactberry/system/providers";
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
<DesignSystemProvider>{children}</DesignSystemProvider>
</body>
</html>
);
}
Import the core UI primitives from @reactberry/system/elements.
Example for app/page.tsx:
import { Box, Button, Text } from "@reactberry/system/elements";
export default function HomePage() {
return (
<Box p="l" display="flex" flexDirection="column" gap="m">
<Text as="h1" fontSize="xxxl" fontWeight="700">
Hello Reactberry
</Text>
<Text as="p" color="secondary">
Your design system is now wired into Next.js.
</Text>
<Button variant="default">Get Started</Button>
</Box>
);
}
Prefer the package subpaths when building your app:
@reactberry/system/providers@reactberry/system/elements@reactberry/system/blocks@reactberry/system/themesThat keeps imports explicit and matches how the package is exported.
DesignSystemProvider includes the styled-components registry and theme setup.light.themeName to the provider if you want to switch themes later.Once the provider and primitives are working, continue with Theming, then read Elements and Blocks to understand how Reactberry is organized.