Skip to content

Frontend Overview

The Rebase frontend is a React framework that renders your admin panel. It reads your collection definitions and generates tables, forms, navigation, and routing automatically.

The key components that make up a Rebase frontend:

<Rebase
client={rebaseClient}
collectionRegistryController={collectionRegistryController}
cmsUrlController={cmsUrlController}
navigationStateController={navigationStateController}
authController={authController}
>
{({ loading }) => (
<Scaffold>
<AppBar />
<Drawer title="My App" />
<Outlet />
<SideDialogs />
</Scaffold>
)}
</Rebase>

<Rebase> is the root provider that makes all Rebase functionality available to child components via context. It accepts:

PropDescription
clientRebaseClient instance for data, auth, and storage
collectionRegistryControllerResolves collection paths and configurations
cmsUrlControllerBuilds URLs and handles routing
navigationStateControllerManages navigation state, views, and plugins
authControllerAuthentication state and methods
storageSourceFile storage operations
userConfigPersistenceLocal UI preferences (column widths, etc.)
entityViewsGlobal custom entity view tabs
entityActionsGlobal entity actions
pluginsPlugin instances (legacy prop — prefer passing via navigation controller)

Controllers are React hooks that configure specific aspects of the framework:

The main controller that wires everything together:

const navigationStateController = useBuildNavigationStateController({
collections: () => [...collections], // Collection definitions
views: customViews, // Custom navigation views
plugins, // Plugin instances
authController,
data: rebaseClient.data,
collectionRegistryController,
cmsUrlController,
adminMode: adminModeController.mode,
userManagement
});

Manages how collections are resolved from URL paths:

const collectionRegistryController = useBuildCollectionRegistryController({
userConfigPersistence
});

Configures URL generation:

const cmsUrlController = useBuildCMSUrlController({
basePath: "/",
baseCollectionPath: "/c",
collectionRegistryController
});

Manages light/dark theme:

const modeController = useBuildModeController();
// Provides: modeController.mode ("light" | "dark"), modeController.toggleMode()

Toggles between Studio and Content modes:

const adminModeController = useBuildAdminModeController();
// Provides: adminModeController.mode ("studio" | "content")
ComponentDescription
<Scaffold>Main layout container with responsive sidebar
<AppBar>Top navigation bar with search, mode toggle, user menu
<Drawer>Side navigation with collection list and view links
<SideDialogs>Container for side panel entity editors
<RebaseRoutes>Route container that integrates with React Router
<RebaseRoute>Handles collection routes (/c/*)
<ContentHomePage>Default home page showing collection cards
<StudioHomePage>Studio mode home page with developer tools

Add top-level navigation views for dashboards, tools, or custom pages:

const views: CMSView[] = [
{
slug: "dashboard",
name: "Dashboard",
icon: "dashboard",
group: "Analytics",
view: <MyDashboard />
},
{
slug: "settings",
name: "App Settings",
icon: "settings",
view: <AppSettings />,
nestedRoutes: true // Support sub-paths
}
];

Rebase uses Tailwind CSS v4 and supports light/dark modes. Customize via:

  • CSS custom properties — Override design tokens
  • ModeControllerProvider — Control light/dark mode
  • Tailwind config — Standard Tailwind customization
/* Override design tokens */
:root {
--font-sans: "Inter", sans-serif;
--font-mono: "JetBrains Mono", monospace;
}