Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find a list of the components included by default with Blazor?

Tags:

I am just beginning to learn Blazor, and my google-fu seems to be failing me here. From what I understand, Blazor includes certain components by default (EditForm for instance). I would like to know which components are available to me.

The problem is, when I google blazor components I end up with a whole slew of third party component packages, some free and some free until you actually want to use them.

Where would I find a canonical list of the components that are available in a standard Blazor installation so that I can learn them before I decide to bring in any third party dependencies into my project?

like image 518
Michael Jordan Avatar asked Jan 10 '20 16:01

Michael Jordan


People also ask

Does Blazor have components?

Blazor apps are built using Razor components, informally known as Blazor components. A component is a self-contained portion of user interface (UI) with processing logic to enable dynamic behavior. Components can be nested, reused, shared among projects, and used in MVC and Razor Pages apps.

How do you reference a component in Blazor?

Use the ref attribute for a component and define it filed with the same name and same type of component. While the Counter component is rendered, the field counter is populated along with the component instance. For more information, refer to the link capture-references-to-components.

How do you add Blazor components?

To add a component to the project, right-click on the Pages folder and choose Add -> Razor Component. Refer to the following image. In the Add New Item- Blazor App dialog, provide the name EmployeeCard and click Add.


1 Answers

Those components come form Microsoft.AspNetCore.Components, which are imported in _Imports.razor :

@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing

You can find a list at:

https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.forms?view=aspnetcore-3.1

and

https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.routing?view=aspnetcore-3.1

like image 188
tbdrz Avatar answered Nov 10 '22 02:11

tbdrz