|
1 | 1 | ---
|
2 | 2 | layout: post
|
3 |
| -title: Code Snippet | Blazor | Syncfusion |
4 |
| -description: Code snippet adding a Syncfusion Blazor component with various features in the Razor code editor file of the Blazor Application. |
| 3 | +title: Code Snippets - Blazor Extension Visual Studio Code | Syncfusion |
| 4 | +description: Learn here all about how to use code snippet utility of Syncfusion Blazor Extension for Visual Studio Code and much more. |
5 | 5 | platform: extension
|
6 | 6 | control: Syncfusion Extensions
|
7 | 7 | documentation: ug
|
8 | 8 | ---
|
9 | 9 |
|
10 |
| -# Add Syncfusion<sup style="font-size:70%">®</sup> Blazor component in the Blazor application |
| 10 | +# Add Syncfusion® Blazor component in the Blazor application |
11 | 11 |
|
12 |
| -The Syncfusion<sup style="font-size:70%">®</sup> Blazor code snippet utility for Visual Studio Code includes snippets for inserting a Syncfusion<sup style="font-size:70%">®</sup> Blazor component with various features into the Blazor Application's Razor code editor. |
| 12 | +The Syncfusion® Blazor code snippet utility for Visual Studio Code includes snippets for inserting a Syncfusion® Blazor component with various features into the Blazor Application's Razor code editor. |
13 | 13 |
|
14 |
| - > The Syncfusion<sup style="font-size:70%">®</sup> Blazor code snippet is available from Essential Studio<sup style="font-size:70%">®</sup> 2021 Volume 1 (`v19.1.0.54`). |
| 14 | + N> The Syncfusion® Blazor code snippet is available from Essential Studio® 2021 Volume 1 (`v19.1.0.54`). |
15 | 15 |
|
16 |
| -## Add a Syncfusion<sup style="font-size:70%">®</sup> Blazor component |
| 16 | +## Add a Syncfusion® Blazor component |
17 | 17 |
|
18 |
| -The instructions below guide you the process of using the Syncfusion<sup style="font-size:70%">®</sup> Blazor code snippet in your Blazor application. |
| 18 | +The instructions below guide you the process of using the Syncfusion® Blazor code snippet in your Blazor application. |
19 | 19 |
|
20 | 20 | 1. In Visual Studio Code, open an existing Blazor Application or create a new Blazor Application.
|
21 | 21 |
|
22 |
| -2. Open the razor file that you need and place the cursor in required place where you want to add Syncfusion<sup style="font-size:70%">®</sup> component. |
| 22 | +2. Open the razor file that you need and place the cursor in required place where you want to add Syncfusion® component. |
23 | 23 |
|
24 |
| -3. You can find the Syncfusion<sup style="font-size:70%">®</sup> Blazor component with the various features by typing the **sf** word in the format shown below. |
25 |
| - |
26 |
| - ```bash |
27 |
| - sf<Syncfusion<sup style="font-size:70%">®</sup> component name>-<Syncfusion<sup style="font-size:70%">®</sup> component feature> |
| 24 | +3. You can find the Syncfusion® Blazor component with the various features by typing the **sf** word in the format shown below. |
28 | 25 |
|
| 26 | + ``` |
| 27 | + sf<Syncfusion component name>-<Syncfusion component feature> |
29 | 28 | For Example, sfgrid-grouping
|
30 | 29 | ```
|
31 |
| -4. Choose the Syncfusion<sup style="font-size:70%">®</sup> component and click the **Enter** or **Tab** key, the Syncfusion<sup style="font-size:70%">®</sup> Blazor component will be added in the razor file. |
| 30 | +4. Choose the Syncfusion® component and click the **Enter** or **Tab** key, the Syncfusion® Blazor component will be added in the razor file. |
32 | 31 |
|
33 | 32 | 
|
34 | 33 |
|
35 |
| -5. After adding the Syncfusion<sup style="font-size:70%">®</sup> Blazor component to the razor file, use the tab key to fill in the required values to render the component with data. You can find the comment section in the code snippet to see what values are required. |
| 34 | +5. After adding the Syncfusion® Blazor component to the razor file, use the tab key to fill in the required values to render the component with data. You can find the comment section in the code snippet to see what values are required. |
36 | 35 |
|
37 | 36 | 
|
38 | 37 |
|
39 |
| -6. You can also find the Syncfusion<sup style="font-size:70%">®</sup> help link at the top of the added snippet to learn more about the new Syncfusion<sup style="font-size:70%">®</sup> Blazor component feature. |
| 38 | +6. You can also find the Syncfusion® help link at the top of the added snippet to learn more about the new Syncfusion® Blazor component feature. |
40 | 39 |
|
41 | 40 | 
|
42 | 41 |
|
43 |
| -## Configure Blazor application with Syncfusion<sup style="font-size:70%">®</sup> |
| 42 | +## Configure Blazor application with Syncfusion |
44 | 43 |
|
45 |
| -The Syncfusion<sup style="font-size:70%">®</sup> Blazor snippet simply inserts the code into the razor file. You must configure the Blazor application with Syncfusion<sup style="font-size:70%">®</sup> by installing the Syncfusion<sup style="font-size:70%">®</sup> Blazor NuGet package, namespace, themes, and registering the Syncfusion<sup style="font-size:70%">®</sup> Blazor Service. To configure, follow the steps below: |
| 44 | +The Syncfusion® Blazor snippet simply inserts the code into the razor file. You must configure the Blazor application with Syncfusion® by installing the Syncfusion® Blazor NuGet package, namespace, themes, and registering the Syncfusion® Blazor Service. To configure, follow the steps below: |
46 | 45 |
|
47 |
| -1. Open the Blazor application file and manually add the required Syncfusion<sup style="font-size:70%">®</sup> Blazor individual NuGet package(s) for the Syncfusion<sup style="font-size:70%">®</sup> Blazor components as a package reference. Refer to [this section](https://blazor.Syncfusion.com/documentation/nuget-packages/#benefits-of-using-individual-nuget-packages) to learn about the advantages of the individual NuGet packages. This NuGet package will be automatically restored when building the application. |
| 46 | +1. Open the Blazor application file and manually add the required Syncfusion® Blazor individual NuGet package(s) for the Syncfusion® Blazor components as a package reference. Refer to [this section](https://blazor.syncfusion.com/documentation/nuget-packages#benefits-of-using-individual-nuget-packages) to learn about the advantages of the individual NuGet packages. This NuGet package will be automatically restored when building the application. |
48 | 47 |
|
49 | 48 | 
|
50 | 49 |
|
51 |
| - > Starting with Volume 4, 2020 (v18.4.0.30) release, Syncfusion<sup style="font-size:70%">®</sup> provides [individual NuGet packages](https://blazor.Syncfusion.com/documentation/nuget-packages/) for our Syncfusion<sup style="font-size:70%">®</sup> Blazor components. We highly recommend this new standard for your Blazor production applications. |
| 50 | + N> Starting with Volume 4, 2020 (v18.4.0.30) release, Syncfusion® provides [individual NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages) for our Syncfusion® Blazor components. We highly recommend this new standard for your Blazor production applications. |
52 | 51 |
|
53 |
| -2. To render the Syncfusion<sup style="font-size:70%">®</sup> components in your application, open the **~/_Imports.razor** file and add the required Syncfusion<sup style="font-size:70%">®</sup> Blazor namespace entries. |
| 52 | +2. To render the Syncfusion® components in your application, open the **~/_Imports.razor** file and add the required Syncfusion® Blazor namespace entries. |
54 | 53 |
|
55 | 54 | 
|
56 | 55 |
|
57 |
| -3. Add the Syncfusion<sup style="font-size:70%">®</sup> Blazor [theme](https://blazor.Syncfusion.com/documentation/appearance/themes/) in the `<head>` element of the **~/Pages/_Host.html** page for server application and **~/wwwroot/index.html** page for a client application. |
| 56 | +3. Add the Syncfusion® Blazor [theme](https://blazor.syncfusion.com/documentation/appearance/themes) in the `<head>` element of the **~/Components/App.razor** page for Web App and `<head>` element of the **~/Pages/_Host.html** page for server application and **~/wwwroot/index.html** page for a client application. |
58 | 57 |
|
59 | 58 | 
|
60 | 59 |
|
61 |
| -4. Open the **~/Startup.cs** file for server application and the **~/Program.cs** file for client application then register the Syncfusion<sup style="font-size:70%">®</sup> Blazor Service. |
| 60 | +4. Open the **~/Program.cs** file for Web App and server application and client application then register the Syncfusion® Blazor Service. |
| 61 | +
|
| 62 | +If you select an **Interactive render mode** as `WebAssembly` or `Auto`, you need to register the Syncfusion® Blazor service in both **~/Program.cs** files of your Blazor Web App. |
62 | 63 |
|
63 |
| -  |
| 64 | +  |
64 | 65 |
|
65 |
| -5. If you installed the trial setup or NuGet packages from nuget.org you must register the Syncfusion<sup style="font-size:70%">®</sup> license key to your application since Syncfusion<sup style="font-size:70%">®</sup> introduced the licensing system from 2018 Volume 2 (v16.2.0.41) Essential Studio<sup style="font-size:70%">®</sup> release. Navigate to the [help topic](https://help.Syncfusion.com/common/essential-studio/licensing/overview#how-to-generate-Syncfusion-license-key) to generate and register the Syncfusion<sup style="font-size:70%">®</sup> license key to your application. Refer to this [blog](https://www.Syncfusion.com/blogs/post/whats-new-in-2018-volume-2.aspx) post for understanding the licensing changes introduced in Essential Studio<sup style="font-size:70%">®</sup>. |
| 66 | +5. If you installed the trial setup or NuGet packages from nuget.org you must register the Syncfusion® license key to your application since Syncfusion® introduced the licensing system from 2018 Volume 2 (v16.2.0.41) Essential Studio® release. Navigate to the [help topic](https://help.syncfusion.com/common/essential-studio/licensing/overview#how-to-generate-syncfusion-license-key) to generate and register the Syncfusion® license key to your application. Refer to this [UG](https://blazor.syncfusion.com/documentation/getting-started/license-key/overview) topic for understanding the licensing details in Essential Studio® for Blazor. |
0 commit comments