Razor class libraries were introduced to ASP.NET Core 2.2. What it means is that all components—code- or file-based—can be added to an assembly and then referenced by an application. If, for example, this class library contains multiple .cshtml files, we can refer to them in our controllers or provide overrides for them in the application, provided that the same path is respected. Think, for example, of the authentication and registration views provided by Identity; if you don't like any of them, you can provide an alternative one while keeping the others.
Razor class libraries can be created using Visual Studio:
It essentially produces a .csproj file that uses the Microsoft.NET.Sdk.RazorSDK (Razor class libraries) instead of Microsoft.NET.Sdk.Web(for web applications) or Microsoft.NET.Sdk (for .NET Core assemblies):
<ProjectSdk="Microsoft.NET.Sdk.Razor">...