Introduction
Before we get started, if you are new to SharePoint Framework, please take a look at below articles about building SharePoint Framework webparts and extensions using the below links:
SharePoint Framework are extensions of the type Application.Customizer, which helps to perform JavaScript actions. By default, we have placeholders to render Headers and Footers in the SharePoint modern page.
SPFx Breadcrumb Workaround
Here we are going to use the same concept to implement BreadCrumb as well. But we don’t have default placeholder to get this done. We are going to see a workaround to implement breadcrumb in the SharePoint modern page under the Site Title. In short, we are going to do the below steps:
- Identify the Site Title element using any of the JavaScript element selectors like ID, ClassName, TagName, AttributeName.
- Create a new element for BreadCrumb in the DOM.
- Append the new element next to the Site Title element.
Risks Involved
Since we are using our own workaround, there are risks involved in this approach. If Microsoft updated the Site Title section and removed/renamed any of the selectors that we use to identify the Site Title element, our approach will fail here.
But Site Title is an area that is stable for years, so it won’t be updated often. When you choose to do these types of customizations, you need to be clever and find the element to handle worst-case scenarios.
Implementation
Step 1
Create a new application as SPFx Extension Application.Customizer.
Step 2
Create a React Component for BreadCrumb using the OfficeUI Fabric component.
In Office UI Fabric, we have a component for breadcrumb. Let’s use that by importing the reference, like below:
- import { Breadcrumb, IBreadcrumbItem } from 'office-ui-fabric-react/lib/Breadcrumb';
Check out the available properties of the component in the official documentation for Office UI Fabric breadcrumb and generate your breadcrumb.
Below is how the render method of this component will look:
- public render() {
- return (
- <Breadcrumb items={this.props.items} />);
- }
Step 3
Go to the typescript file generated in the name of your extension. Below is the location of the typescript file:
- src/extensions/{YourExtensionName}/{YourExtensionName} ApplicationCustomizer.ts
Step 4

Mukesh Singh YadavPosted Jan 27, 2021, 10:37 AM
Is it possible to customize .sppkg file in sharePoint framework if i have not solution folder only have sppkg file
Sagar PardeshiPosted May 12, 2020, 11:42 PM
Good to explore the Breadcrumb concept.