Creating a Razor Class Library

Learn how to create shareable components in Blazor WebAssembly.

We can share components across projects by using a Razor class library. To create a Razor class library, we will use the Razor Class Library project template. We do this as follows:

  1. Right-click the solution and select the “Add, New Project” option from the menu.
  2. Enter “Razor Class Library” in the “Search for templates” textbox to locate the Razor Class Library project template:

Get hands-on with 1200+ tech skills courses.