You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: blazor/timeline/getting-started-webapp.md
+76-47Lines changed: 76 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ documentation: ug
9
9
10
10
# Getting Started with Blazor Timeline in Blazor Web App
11
11
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/).
13
13
14
14
{% tabcontents %}
15
15
@@ -21,17 +21,19 @@ This section explains how to integrate the Syncfusion [Blazor Timeline](https://
21
21
22
22
## Create a New Blazor Web App in Visual Studio
23
23
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<supstyle="font-size:70%">®</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<supstyle="font-size:70%">®</sup> Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-integration/template-studio).
25
25
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
+

27
29
28
30
## Install Syncfusion<supstyle="font-size:70%">®</sup> Blazor Layouts and Themes NuGet in the App
29
31
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/).
31
33
32
-
If `WebAssembly or Auto` render modes are utilized in the Blazor Web App need to be install Syncfusion<supstyle="font-size:70%">®</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<supstyle="font-size:70%">®</sup> Blazor component NuGet packages in the client project.
33
35
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.
N> Syncfusion<supstyle="font-size:70%">®</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<supstyle="font-size:70%">®</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.
## Create a New Blazor Web App in Visual Studio Code
56
58
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<supstyle="font-size:70%">®</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<supstyle="font-size:70%">®</sup> Blazor Extension](https://blazor.syncfusion.com/documentation/visual-studio-code-integration/create-project).
58
60
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).
60
62
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.
62
64
63
65
{% tabs %}
64
66
{% highlight c# tabtitle="Blazor Web App" %}
@@ -70,11 +72,9 @@ cd BlazorWebApp.Client
70
72
{% endhighlight %}
71
73
{% endtabs %}
72
74
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
-
75
75
## Install Syncfusion<supstyle="font-size:70%">®</sup> Blazor Layouts and Themes NuGet in the App
76
76
77
-
If `WebAssembly` or `Auto` render modes are utilized in the Blazor Web App, install Syncfusion<supstyle="font-size:70%">®</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<supstyle="font-size:70%">®</sup> Blazor component NuGet packages in the client project.
78
78
79
79
* Press <kbd>Ctrl</kbd>+<kbd>`</kbd> to open the integrated terminal in Visual Studio Code.
80
80
* Ensure the project root directory where the `.csproj` file is located is the current directory.
@@ -92,20 +92,69 @@ dotnet restore
92
92
93
93
{% endtabs %}
94
94
95
-
N> Syncfusion<supstyle="font-size:70%">®</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<supstyle="font-size:70%">®</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.
96
96
97
97
{% endtabcontent %}
98
98
99
-
{% endtabcontents %}
99
+
{% tabcontent .NET CLI %}
100
100
101
-
## Register Syncfusion<supstyle="font-size:70%">®</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).
102
118
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:
107
120
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<supstyle="font-size:70%">®</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<supstyle="font-size:70%">®</sup> Blazor component NuGet packages in the client project.
N> Syncfusion<supstyle="font-size:70%">®</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.
109
158
110
159
{% tabs %}
111
160
{% highlight C# tabtitle="~/_Imports.razor" %}
@@ -116,9 +165,11 @@ Import the `Syncfusion.Blazor` and `Syncfusion.Blazor.Layouts` namespace.
116
165
{% endhighlight %}
117
166
{% endtabs %}
118
167
119
-
Now, register the Syncfusion<supstyle="font-size:70%">®</sup> Blazor Service in the **~/Program.cs** file of the Blazor Web App.
168
+
## Register Syncfusion<supstyle="font-size:70%">®</sup> Blazor Service
169
+
170
+
Register the Syncfusion<supstyle="font-size:70%">®</sup> Blazor Service in the **~/Program.cs** file of the Blazor Web App.
120
171
121
-
If the **Interactive Render Mode** is set to `WebAssembly` or `Auto`, register the Syncfusion<supstyle="font-size:70%">®</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<supstyle="font-size:70%">®</sup> Blazor service in the**~/Program.cs** files of the main `server`project and associated `.Client` project.
If the **Interactive Render Mode** is set to `Server`, Register the Syncfusion<supstyle="font-size:70%">®</sup> Blazor Service only in the server-side **~/Program.cs** file.
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
Add the Syncfusion<supstyle="font-size:70%">®</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<supstyle="font-size:70%">®</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:
198
228
199
229
| Interactivity location | RenderMode | Code |
200
230
| --- | --- | --- |
201
231
| Per page/component | Auto |@rendermode InteractiveAuto |
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.
0 commit comments