@mercurjs/dashboard-sdk). Customization is file-based and convention-driven — you add pages by creating files, configure navigation through exports, and override components through config.
Setup
Every panel project needs two files at its root:Vite config
vite.config.ts
Mercur config
mercur.config.ts
| Option | Type | Description |
|---|---|---|
name | string | Application name shown in the sidebar |
logo | string | URL to a logo image |
components | object | Component overrides (see Replacing components) |
i18n | object | Internationalization settings |
backendUrl | string | Medusa backend URL (default: http://localhost:9000) |
Adding pages
Create apage.tsx file inside src/routes/ and export a default React component. The route is determined by the file path.
src/routes/reviews/page.tsx
/reviews route and adds a “Reviews” item to the sidebar.
The config export
The config export controls how the page appears in navigation:
| Property | Type | Description |
|---|---|---|
label | string | Required. Text shown in the sidebar menu |
icon | ComponentType | Icon component (e.g. from @medusajs/icons) |
rank | number | Sort order — lower numbers appear first |
nested | string | Parent path for nested menu items |
translationNs | string | i18n namespace for the label |
public | boolean | If true, the route is accessible without authentication |
config export are still routed but won’t appear in the sidebar.
Routing conventions
File paths map to URL routes automatically:| File path | Route | Description |
|---|---|---|
src/routes/page.tsx | / | Root page |
src/routes/reviews/page.tsx | /reviews | Static segment |
src/routes/reviews/[id]/page.tsx | /reviews/:id | Dynamic segment |
src/routes/reviews/[[id]]/page.tsx | /reviews/:id? | Optional dynamic segment |
src/routes/search/[*].tsx | /search/* | Catch-all |
src/routes/(settings)/page.tsx | Route grouping | Groups routes without adding a URL segment |
src/routes/dashboard/@sidebar/page.tsx | Parallel route | Renders alongside parent |
Navigation
Sidebar items are generated from pages that export aconfig with a label.
Ordering
Userank to control the order. Lower values appear higher:
Nested menus
Usenested to group pages under a parent:
src/routes/settings/shipping/page.tsx
/settings in the sidebar.
Branding
Setname and logo in mercur.config.ts to customize the sidebar header:
mercur.config.ts
Replacing components
Override built-in layout components inmercur.config.ts:
mercur.config.ts
src/. Each file must have a default export:
src/components/custom-topbar-actions.tsx
| Component | Description |
|---|---|
MainSidebar | Primary navigation sidebar |
SettingsSidebar | Settings section sidebar |
TopbarActions | Action buttons in the top bar |
Internationalization
1. Create translation resourcessrc/i18n/index.ts
src/routes/reviews/page.tsx
mercur.config.ts