Skip to content

Commit ba48de2

Browse files
committed
Updated Blazor components Getting Started UG documentation for Blazor Web App
1 parent 86165d3 commit ba48de2

16 files changed

+581
-376
lines changed

blazor/timeline/getting-started-webapp.md

Lines changed: 76 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ documentation: ug
99

1010
# Getting Started with Blazor Timeline in Blazor Web App
1111

12-
This section explains how to integrate the Syncfusion [Blazor Timeline](https://www.syncfusion.com/blazor-components/blazor-timeline) component into a Blazor Web App using [Visual Studio](https://visualstudio.microsoft.com/vs/) and Visual Studio Code.
12+
This section explains how to integrate the Syncfusion [Blazor Timeline](https://www.syncfusion.com/blazor-components/blazor-timeline) component into a Blazor Web App using [Visual Studio](https://visualstudio.microsoft.com/vs/), [Visual Studio Code](https://code.visualstudio.com/), and the [.NET CLI](https://learn.microsoft.com/en-us/dotnet/core/tools/).
1313

1414
{% tabcontents %}
1515

@@ -21,17 +21,19 @@ This section explains how to integrate the Syncfusion [Blazor Timeline](https://
2121

2222
## Create a New Blazor Web App in Visual Studio
2323

24-
Create a **Blazor Web App** using Visual Studio 2022 via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-8.0) or the [Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-integration/template-studio).
24+
Create a **Blazor Web App** using Visual Studio 2022 via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-10.0&pivots=vs) or the [Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-integration/template-studio).
2525

26-
Configure the corresponding [Interactive render mode](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0#render-modes) and [Interactivity location](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-8.0&pivots=windows) when creating a Blazor Web Application.
26+
Configure the appropriate [Interactive render mode](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-10.0#render-modes) and [Interactivity location](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-10.0&pivots=vs) while creating a Blazor Web App.
27+
28+
![Create Blazor Web App dialog in Visual Studio](images/blazor-create-web-app.png)
2729

2830
## Install Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Layouts and Themes NuGet in the App
2931

30-
To add **Blazor Timeline** component in the app, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), search and install [Syncfusion.Blazor.Layouts](https://www.nuget.org/packages/Syncfusion.Blazor.Layouts/) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/).
32+
To add the **Blazor Timeline** component in the app, open the NuGet package manager in Visual Studio (*Tools → NuGet Package Manager → Manage NuGet Packages for Solution*), then search and install [Syncfusion.Blazor.Layouts](https://www.nuget.org/packages/Syncfusion.Blazor.Layouts/) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/).
3133

32-
If `WebAssembly or Auto` render modes are utilized in the Blazor Web App need to be install Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor component NuGet packages are installed within the client project.
34+
If using the `WebAssembly or Auto` render modes in the Blazor Web App, install Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor component NuGet packages in the client project.
3335

34-
Alternatively, the Package Manager Console can be used to install the required NuGet package
36+
Alternatively, run the following commands in the Package Manager Console to achieve the same.
3537

3638
{% tabs %}
3739
{% highlight C# tabtitle="Package Manager" %}
@@ -42,7 +44,7 @@ Install-Package Syncfusion.Blazor.Themes -Version {{ site.releaseversion }}
4244
{% endhighlight %}
4345
{% endtabs %}
4446

45-
N> Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor components are available in [nuget.org](https://www.nuget.org/packages?q=syncfusion.blazor). Refer to [NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) topic for available NuGet packages list with component details.
47+
N> Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor components are available in [nuget.org](https://www.nuget.org/packages?q=syncfusion.blazor). Refer to the [NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) topic for the available NuGet packages list with component details.
4648

4749
{% endtabcontent %}
4850

@@ -54,11 +56,11 @@ N> Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor components are availa
5456

5557
## Create a New Blazor Web App in Visual Studio Code
5658

57-
A **Blazor Web App** can be created using Visual Studio Code via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-8.0&pivots=vsc) or the [Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-code-integration/create-project).
59+
Create a **Blazor Web App** using Visual Studio Code via [Microsoft Templates](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-10.0&pivots=vsc) or the [Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-code-integration/create-project).
5860

59-
Configure the corresponding [Interactive render mode](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0#render-modes) and [Interactivity location](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?view=aspnetcore-8.0&pivots=vsc) when creating a Blazor Web Application.
61+
Configure the appropriate interactive render mode and interactivity location when setting up a Blazor Web App. For detailed information, refer to the [interactive render mode documentation](https://blazor.syncfusion.com/documentation/common/interactive-render-mode).
6062

61-
For example, in a Blazor Web App with the `Auto` interactive render mode, use the following commands.
63+
For example, to create a Blazor Web App with the `Auto` interactive render mode, use the following commands.
6264

6365
{% tabs %}
6466
{% highlight c# tabtitle="Blazor Web App" %}
@@ -70,11 +72,9 @@ cd BlazorWebApp.Client
7072
{% endhighlight %}
7173
{% endtabs %}
7274

73-
N> For more information on creating a **Blazor Web App** with various interactive modes and locations, refer to this [link](https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app?tabcontent=visual-studio-code#render-interactive-modes).
74-
7575
## Install Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Layouts and Themes NuGet in the App
7676

77-
If `WebAssembly` or `Auto` render modes are utilized in the Blazor Web App, install Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor component NuGet packages within the client project.
77+
If using the `WebAssembly` or `Auto` render modes in the Blazor Web App, install Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor component NuGet packages in the client project.
7878

7979
* Press <kbd>Ctrl</kbd>+<kbd>`</kbd> to open the integrated terminal in Visual Studio Code.
8080
* Ensure the project root directory where the `.csproj` file is located is the current directory.
@@ -92,20 +92,69 @@ dotnet restore
9292

9393
{% endtabs %}
9494

95-
N> Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor components are available in [nuget.org](https://www.nuget.org/packages?q=syncfusion.blazor). Refer to [NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) topic for available NuGet packages list with component details.
95+
N> Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor components are available in [nuget.org](https://www.nuget.org/packages?q=syncfusion.blazor). Refer to the [NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) topic for the available NuGet packages list with component details.
9696

9797
{% endtabcontent %}
9898

99-
{% endtabcontents %}
99+
{% tabcontent .NET CLI %}
100100

101-
## Register Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Service
101+
## Prerequisites
102+
103+
Latest version of the [.NET SDK](https://dotnet.microsoft.com/en-us/download). If you previously installed the SDK, you can determine the installed version by executing the following command in a command prompt (Windows) or terminal (macOS) or command shell (Linux).
104+
105+
{% tabs %}
106+
{% highlight c# tabtitle=".NET CLI" %}
107+
108+
dotnet --version
109+
110+
{% endhighlight %}
111+
{% endtabs %}
112+
113+
## Create a Blazor Web App using .NET CLI
114+
115+
Run the following command to create a new Blazor Web App in a command prompt (Windows) or terminal (macOS) or command shell (Linux). For detailed instructions, refer to [this Blazor Web App Getting Started](https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app?tabcontent=.net-cli) documentation.
116+
117+
Configure the appropriate interactive render mode and interactivity location when setting up a Blazor Web Application. For detailed information, refer to the [interactive render mode documentation](https://blazor.syncfusion.com/documentation/common/interactive-render-mode).
102118

103-
| Interactive Render Mode | Description |
104-
| -- | -- |
105-
| WebAssembly or Auto | Open **~/_Imports.razor** file from the client project.|
106-
| Server | Open **~/_import.razor** file, which is located in the `Components` folder.|
119+
For example, to create a Blazor Web App with the `Auto` interactive render mode, use the following commands:
107120

108-
Import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Layouts` namespace.
121+
{% tabs %}
122+
{% highlight c# tabtitle=".NET CLI" %}
123+
124+
dotnet new blazor -o BlazorApp -int Auto
125+
cd BlazorApp
126+
cd BlazorApp.Client
127+
128+
{% endhighlight %}
129+
{% endtabs %}
130+
131+
This command creates a new Blazor Web App and places it in a new directory called `BlazorApp` inside your current location. See the [Create a Blazor App](https://dotnet.microsoft.com/en-us/learn/aspnet/blazor-tutorial/create) and [dotnet new CLI command](https://learn.microsoft.com/en-us/aspnet/core/blazor/tooling?pivots=cli&view=aspnetcore-10.0) topics for more details.
132+
133+
## Install Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Layouts and Themes NuGet in the App
134+
135+
Here's an example of how to add **Blazor Timeline** component in the application using the following command in the command prompt (Windows) or terminal (Linux and macOS) to install a [Syncfusion.Blazor.Layouts](https://www.nuget.org/packages/Syncfusion.Blazor.Layouts/) and [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes/) NuGet package. See [Install and manage packages using the dotnet CLI](https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-dotnet-cli) topics for more details.
136+
137+
If using the `WebAssembly or Auto` render modes in the Blazor Web App, install Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor component NuGet packages in the client project.
138+
139+
{% tabs %}
140+
{% highlight c# tabtitle=".NET CLI" %}
141+
142+
dotnet add package Syncfusion.Blazor.Layouts --version {{ site.releaseversion }}
143+
dotnet add package Syncfusion.Blazor.Themes --version {{ site.releaseversion }}
144+
dotnet restore
145+
146+
{% endhighlight %}
147+
{% endtabs %}
148+
149+
N> Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor components are available in [nuget.org](https://www.nuget.org/packages?q=syncfusion.blazor). Refer to the [NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) topic for the available NuGet packages list with component details.
150+
151+
{% endtabcontent %}
152+
153+
{% endtabcontents %}
154+
155+
## Add Import Namespaces
156+
157+
Open the **~/_Imports.razor** file from the client project and import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Layouts` namespaces.
109158

110159
{% tabs %}
111160
{% highlight C# tabtitle="~/_Imports.razor" %}
@@ -116,9 +165,11 @@ Import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Layouts` namespace.
116165
{% endhighlight %}
117166
{% endtabs %}
118167

119-
Now, register the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Service in the **~/Program.cs** file of the Blazor Web App.
168+
## Register Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Service
169+
170+
Register the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Service in the **~/Program.cs** file of the Blazor Web App.
120171

121-
If the **Interactive Render Mode** is set to `WebAssembly` or `Auto`, register the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor service in both **~/Program.cs** files (`server` and `client` projects) of the Blazor Web App.
172+
If the **Interactive Render Mode** is set to `WebAssembly` or `Auto`, register the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor service in the **~/Program.cs** files of the main `server` project and associated `.Client` project.
122173

123174
{% tabs %}
124175
{% highlight c# tabtitle="Server(~/_Program.cs)" hl_lines="3 11" %}
@@ -152,27 +203,6 @@ await builder.Build().RunAsync();
152203
{% endhighlight %}
153204
{% endtabs %}
154205

155-
If the **Interactive Render Mode** is set to `Server`, Register the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Service only in the server-side **~/Program.cs** file.
156-
157-
{% tabs %}
158-
{% highlight c# tabtitle="~/_Program.cs" hl_lines="2 9" %}
159-
160-
...
161-
using Syncfusion.Blazor;
162-
163-
var builder = WebApplication.CreateBuilder(args);
164-
165-
// Add services to the container.
166-
builder.Services.AddRazorComponents()
167-
.AddInteractiveServerComponents();
168-
builder.Services.AddSyncfusionBlazor();
169-
170-
var app = builder.Build();
171-
....
172-
173-
{% endhighlight %}
174-
{% endtabs %}
175-
176206
## Add Stylesheet and Script Resources
177207

178208
The theme stylesheet and script can be accessed from NuGet through [Static Web Assets](https://blazor.syncfusion.com/documentation/appearance/themes#static-web-assets). Include the stylesheet reference in the `<head>` section and the script reference at the end of the `<body>` in the **~/Components/App.razor** file as shown below:
@@ -194,16 +224,15 @@ N> Review the [Blazor Themes](https://blazor.syncfusion.com/documentation/appear
194224

195225
## Add Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Timeline component
196226

197-
Add the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Timeline component in the **~Pages/.razor** file. If an interactivity location as `Per page/component` in the web app, define a render mode at the top of the `~Pages/.razor` component, as follows:
227+
Add the Syncfusion<sup style="font-size:70%">&reg;</sup> Blazor Timeline component to a Razor page located under the Pages folder (e.g., Pages/Home.razor) in either the **Server** or **Client** project. If an interactivity location as `Per page/component` in the web app, define a render mode at top of the component, as follows:
198228

199229
| Interactivity location | RenderMode | Code |
200230
| --- | --- | --- |
201231
| Per page/component | Auto | @rendermode InteractiveAuto |
202232
| | WebAssembly | @rendermode InteractiveWebAssembly |
203-
| | Server | @rendermode InteractiveServer |
204233
| | None | --- |
205234

206-
N> If an **Interactivity Location** is set to `Global` and the **Render Mode** is set to `Auto` or `WebAssembly` or `Server`, the render mode is configured in the `App.razor` file by default.
235+
N> If an **Interactivity Location** is set to `Global` and the **Render Mode** is set to `Auto` or `WebAssembly`, the render mode is configured in the `App.razor` file by default.
207236

208237
{% tabs %}
209238
{% highlight razor %}
79.4 KB
Loading

0 commit comments

Comments
 (0)