Customise Dashboard
Start with Medusa’s native Admin extensions: widgets and pages in src/admin. When you need to change Dashboard itself, copy its source into your project.
Add a widget
This example adds a widget to the native order.details.after zone on an order detail page.
// src/admin/widgets/order-note.tsx
import { defineWidgetConfig } from "@medusajs/admin-sdk"
import { Container, Heading, Text } from "@medusajs/ui"
import { DetailWidgetProps, AdminOrder } from "@medusajs/framework/types"
const OrderNote = ({ data }: DetailWidgetProps<AdminOrder>) => (
<Container>
<Heading level="h2">Note</Heading>
<Text size="small">Order {data.display_id}</Text>
</Container>
)
export const config = defineWidgetConfig({ zone: "order.details.after" })
export default OrderNoteAdd a page to the B2B section
Create a UI route under src/admin/routes/b2b/ and give it a label in defineRouteConfig. With Core installed, it appears in the B2B section of the native Admin and Manta Dashboard.
// src/admin/routes/b2b/reports/page.tsx
import { defineRouteConfig } from "@medusajs/admin-sdk"
import { DocumentText } from "@medusajs/icons"
import { Container, Heading } from "@medusajs/ui"
const Reports = () => (
<Container>
<Heading>Reports</Heading>
</Container>
)
export const config = defineRouteConfig({ label: "Reports", icon: DocumentText })
export default ReportsCopy the source (eject)
To change Dashboard in depth, copy its source into your project:
npx b2b-dashboard eject # copies the source into ./b2b-dashboardUpdate the existing withB2BDashboard call as shown below, then run npx medusa build.
// medusa-config.ts — preserve the existing Admin options.
import { withB2BDashboard } from "@mantajs/dashboard/config"
// Inside defineConfig({ ... }):
admin: withB2BDashboard({
// Keep your existing Admin options here.
}, { ejected: "./b2b-dashboard" }),- The copy contains
src/, the licence files andEJECTED.json(every file with its checksum). - The command never overwrites an existing folder and never writes into
src/admin. - The build then compiles
./b2b-dashboard/src. Example: change a label in./b2b-dashboard/src/i18n/translations/en.jsonand rebuild. - An ejected copy no longer gets updates: you own it.
Dashboard commands (optional)
These commands are included in the Dashboard package. They are separate from the planned Manta project CLI. The installation guide uses the configuration helper directly.
| Command | What it does |
|---|---|
npx b2b-dashboard install [--write] [--ejected dir] | Show the configuration change; --write applies it. |
npx b2b-dashboard eject [--out dir] | Copy the source (default: ./b2b-dashboard). |
npx b2b-dashboard inventory [--ejected dir] | Compare expected and installed versions, and report blockers. |
npx b2b-dashboard scan [dir|archive.tgz] | Check the licence scope of a folder or archive (default: package root). |
Each command prints a JSON report and exits with a non-zero code when blocked. None of them touches the database.