This repository provides Visual Studio templates for Telerik Blazor apps with some convenient extras.
When installed, the templates can be used to create new Blazor apps in Visual Studio or with dotnet new
CLI commands.
- Close Visual Studio.
- Download the NuGet package from the latest release to some folder.
- Open your Terminal or Shell app and go to the folder from the previous step.
- Execute the
dotnet new install
command:dotnet new install Dimodi.Telerik.Blazor.Templates.*.nupkg
On Windows, the new project templates will appear in the C#
, Web
and Blazor
categories in the Create New Project wizard. Make sure to select "All platforms" in the respective dropdown.
On Mac, the new project templates will appear in the Other
> Custom
category.
When creating a WebAssembly app, make sure to select the server project as a startup project before running.
For help on a specific project or item template, execute the dotnet new
command with the --help
option, for example:
dotnet new tbgridedit --help
- Open Terminal and go to the desired parent folder of your future app.
- Execute the
dotnet new
command with the short name of the template and the app name, for example:dotnet new tbserver6 -o MyNewAppName
When creating a WebAssembly app, make sure to select the server project as a startup project before running.
The .NET 8 Server template (tbserver8
) sets global Server
interactivity.
The .NET 8 WebAssembly template (tbwasm8
) sets global WebAssembly
interactivity. To create a project with Auto
interactivity, set rendermode
to Auto
in the dotnet new
command:
dotnet new tbwasm8 -o MyNewAppName --rendermode Auto
- Open Terminal and go to a folder inside your existing app, for example
Pages
orComponents
. - Execute the
dotnet new
command with the short name of the template and the file name, for example:dotnet new tbgrid -n MyNewGridPаge
- The above command will produce a
MyNewGridPаge.razor
file inside the current folder.
The item templates provide declarations of Telerik Blazor components together with dummy data, which includes different data types.
The project templates are similar to the default .NET SDK Blazor project templates. The differences are:
- The apps reference the latest Telerik UI for Blazor version. The WebAssembly standalone apps reference the latest minor .NET version.
- The Telerik UI for Blazor NuGet package, namespaces, service, and static assets are added, according to best practices.
- You can configure some settings related to the Telerik UI for Blazor components during app creation (see the default values in the brackets):
- Theme (
Default
) - Icon type (SVG icons or Font icons) (SVG)
- CDN support (disabled)
- RTL support (disabled)
- Theme (
- The Telerik CSS and JS files are loaded with a query string cache buster to prevent browser caching across version upgrades.
Program.cs
contains commented code to increase the maximum file upload size.Program.cs
in server apps contains commented code to increase the maximum SignalR message size.- The
SurveyPrompt
Razor component is removed. - The
<button>
and<table>
HTML elements in the default sample pages are replaced with Telerik Button and Grid.
- Remove the currently installed package:
dotnet new uninstall Dimodi.Telerik.Blazor.Templates
- Repeat the installation steps.
Telerik UI for Blazor is a commercial component library with its own license agreement.
The project templates are subject to MIT License.