This tutorial explains how to add a Register link to the Backstage sidebar for easier component onboarding.
In this tutorial, you’ll learn how to extend Backstage’s default sidebar by injecting a Register link that points directly to the catalog import page (/catalog-import). This simplifies the flow for onboarding existing components, letting users skip the template picker and go straight to registration.
Backstage is built on React Router. Each view is tied to a URL path using <Route> definitions in src/App.tsx. When a user navigates to a path, the corresponding plugin page renders.
Routes are wrapped in <FlatRoutes> from @backstage/core-components, which integrates with React Router v6 under the hood.
The sidebar items live in src/components/Root.tsx. Locate the <SidebarGroup label="Menu"> section and insert your new item:
Copy
Ask AI
// src/components/Root.tsximport React, { PropsWithChildren } from 'react';import { SidebarPage, Sidebar, SidebarGroup, SidebarItem, SidebarDivider, SidebarSearchModal,} from '@backstage/core-components';import HomeIcon from '@material-ui/icons/Home';import ExtensionIcon from '@material-ui/icons/Extension';import LibraryBooksIcon from '@material-ui/icons/LibraryBooks';import CreateIcon from '@material-ui/icons/AddCircleOutline';import MenuIcon from '@material-ui/icons/Menu';import SearchIcon from '@material-ui/icons/Search';import LogoFull from './LogoFull';import LogoIcon from './LogoIcon';// 1. Import the new iconimport AssignmentReturnedIcon from '@material-ui/icons/AssignmentReturned';export const Root = ({ children }: PropsWithChildren<{}>) => ( <SidebarPage> <Sidebar> <SidebarLogo /> <SidebarGroup label="Search" icon={<SearchIcon />} to="/search"> <SidebarSearchModal /> </SidebarGroup> <SidebarDivider /> <SidebarGroup label="Menu" icon={<MenuIcon />}> <SidebarItem icon={HomeIcon} to="catalog" text="Home" /> <SidebarItem icon={ExtensionIcon} to="api-docs" text="APIs" /> <SidebarItem icon={LibraryBooksIcon} to="docs" text="Docs" /> <SidebarItem icon={CreateIcon} to="create" text="Create..." /> {/* 2. Add the Register link */} <SidebarItem icon={AssignmentReturnedIcon} to="catalog-import" text="Register" /> </SidebarGroup> {/* ...other sidebar sections... */} </Sidebar> {children} </SidebarPage>);
Ensure @material-ui/icons is installed and the icon import path matches your version. Run:
Copy
Ask AI
npm install @material-ui/icons
or
Copy
Ask AI
yarn add @material-ui/icons
Save and reload your Backstage app. You’ll now see the Register link in the sidebar:
Clicking Register takes you directly to /catalog-import, where you can provide metadata and complete the registration of existing components.With this enhancement, you’ve:
Reviewed routing setup in Backstage via React Router.
Updated the sidebar UI layout using <SidebarItem> components.
Installed and applied a Material-UI icon for your new link.
Now you can apply these patterns across your Backstage instance to provide tailored navigation for your development teams.