Choose the right tool. A component override replaces one of four global layout slots across the whole panel. If you want to change a single page, re-compose it instead — and if you want to add a new screen, just drop in a route. The decision guide in Extending Panels compares all three.
What you’ll build
A vendor portal with custom topbar actions (a help link and a status badge) and a custom main sidebar, configured entirely fromvite.config.ts.
The available slots
Exactly four layout components can be replaced:| Component | Where it renders |
|---|---|
MainSidebar | Primary navigation sidebar on every main page |
SettingsSidebar | Sidebar of the /settings section |
TopbarActions | Action cluster on the right side of the top bar |
StoreSetup | The store setup screen shown to new sellers (vendor portal) |
Set up the override
Write the replacement component
Create the component anywhere under
src/. It must have a default export:apps/vendor/src/components/topbar-actions.tsx
Register it in the Vite config
Component overrides live in the The plugin resolves each path at build time and swaps your component in through the
components option of mercurDashboardPlugin, in your panel app’s vite.config.ts. Paths are relative to src/:apps/vendor/vite.config.ts
virtual:mercur/components module — no runtime registration, no context providers to wire.Verify
- Open the vendor portal — the top bar shows your badge and Help link on every page.
- Navigate between main pages and
/settings— the override applies everywhere its slot renders. - Remove the
componentsentry and restart — the built-in components return. The originals were never modified.
FAQ
If I replace MainSidebar, do my custom routes still show up in the menu?
If I replace MainSidebar, do my custom routes still show up in the menu?
Can I override other components, like the login page or a form?
Can I override other components, like the login page or a form?
No — these four slots are the complete list. The login flow, forms, and everything page-level are customized through drop-in routes and compound re-composition.
Do overrides apply to both panels?
Do overrides apply to both panels?
Each panel app has its own
vite.config.ts, so overrides are configured per panel. StoreSetup only exists in the vendor portal; the other three slots exist in both.Next steps
Re-compose a built-in page
Change one page’s composition instead of global chrome.
Extending Panels
The full reference for routes, navigation, branding, and overrides.