Hello, platform engineers! π One of the first things you’ll want to do after adopting Backstage is to create a “custom home screen just for your team.”
You’ve written some great custom widget code, but why isn’t it appearing on the home screen? Beyond simply creating a component, you need a ‘connecting link’ that allows the Backstage home plugin to recognize it. From now on, I’ll explain the core secret in detail!

1. Basic Principles of Home Page Widgets π§©
Backstage’s Home page is not just a single page, but a dynamic layout composed of multiple Widgets. For your custom widget to appear on the home screen, two main things need to be prepared:
- Widget Component: The React code that will actually be rendered on the screen.
- Widget Extension: The process of wrapping this component so that Backstage can recognize it as a ‘home widget’.
2. Step 1: Create a Widget Component π»
First, you need to write the actual content to be displayed on the home screen. This is usually located in the src/components folder of your plugin.
TypeScript
// MyCustomWidget.tsx
import React from 'react';
import { InfoCard } from '@backstage/core-components';
export const MyCustomWidget = () => (
<InfoCard title="μ€λμ 곡μ§μ¬ν π’">
<p>νλ«νΌ νμμ μ ν©λλ€. μ€λμ μ κΈ° μ κ²μΌμ
λλ€!</p>
</InfoCard>
);
3. Step 2: The Core! Define the Widget Extension π
This step is the direct answer to the question. Instead of just exporting the widget, you must register it using the createCardExtension function.
- Reason: The Backstage home plugin reads the widget’s metadata through this extension and safely places the widget in the layout engine.
TypeScript
// plugin.ts
import { createCardExtension } from '@backstage/plugin-home';
import { rootRouteRef } from './routes';
export const MyCustomWidgetExtension = homePlugin.provide(
createCardExtension({
name: 'MyCustomWidget',
title: 'λμ 컀μ€ν
μμ ―',
components: () => import('./components/MyCustomWidget').then(m => m.MyCustomWidget),
// You can set the path to navigate to when the widget is clicked, etc.
}),
);
4. Step 3: Place the Widget on HomePage.tsx π
Once you’ve defined the Extension, you now need to go to the actual home page configuration file (App.tsx or HomePage.tsx) and add this widget to the rendering tree.
TypeScript
// App.tsx or HomePage.tsx
import { MyCustomWidgetExtension } from '@internal/plugin-my-custom-plugin';
// ... (omitted)
<Grid item xs={12} md={6}>
<MyCustomWidgetExtension />
</Grid>
Important Note! If the widget depends on other plugins or requires Permissions, that context must exist higher up in the hierarchy.
5. Checklist for Successful Rendering β
If your widget isn’t appearing on the screen, be sure to check these 3 things!
- Export Status: Have you correctly exported the widget extension (MyCustomWidgetExtension) from your plugin’s index.ts?
- Layout Settings: Is the widget occupying too small an area within layout components like
tags? (Check xs, md values) - Dynamic Import (Lazy Loading): If you used the components: () => import(…) format, ensure the path is accurate.
6. Summary: What should you do? π
To render a custom widget on the Backstage home page, you must do the following:
- You must wrap and export the widget with createCardExtension.
- Then, you must place that extension component within your app’s home page layout (HomePage.tsx).
π Concluding Remarks
The Backstage home page is the ‘starting point’ for developers. Create custom widgets for information your team members need to check most frequently (e.g., on-call rotation, build status, team announcements). Even a small widget can significantly boost your team’s productivity! π
Leave a Reply