Reactberry Documentation
A docs site powered entirely by Reactberry itself.
foundations
Use Reactberry's built-in themes and switch between light and dark mode with the provider.
Reactberry ships with theme support built into DesignSystemProvider.
Right now the package exposes two built-in theme names:
lightdarkIf you do nothing, the provider uses the light theme by default.
import { DesignSystemProvider } from "@reactberry/system/providers";
export default function RootLayout({ children }: { children: React.ReactNode }) {
return <DesignSystemProvider>{children}</DesignSystemProvider>;
}
Pass themeName to the provider.
import { DesignSystemProvider } from "@reactberry/system/providers";
export default function RootLayout({ children }: { children: React.ReactNode }) {
return <DesignSystemProvider themeName="dark">{children}</DesignSystemProvider>;
}
DesignSystemProvider handles the Reactberry setup for you:
ThemeProviderIf you need to control global styling yourself, you can disable the built-in global styles.
<DesignSystemProvider withGlobalStyles={false}>{children}</DesignSystemProvider>
Reactberry primitives and blocks read values from the active theme, so common props like these should come from Reactberry instead of custom one-off CSS where possible:
colorskinfontSizefontWeightp, m, gapshapeimport { Box, Button, Text } from "@reactberry/system/elements";
export default function SettingsPage() {
return (
<Box p="l" display="flex" flexDirection="column" gap="m">
<Text as="h1" fontSize="xxl" fontWeight="700">
Theme-aware UI
</Text>
<Text as="p" color="secondary">
The active Reactberry theme controls typography, color, and surfaces.
</Text>
<Button variant="default">Save preferences</Button>
</Box>
);
}
Once theming is in place, continue with Elements to understand the foundational layer, then Blocks for the composed reusable layer.