Live Chat Icon For mobile
Live Chat Icon

How do you dynamically create a component?

Platform: Blazor| Category: Components

The RenderFragment is used to create a component dynamically.

 @page "/"
 @code {
     RenderFragment CreateDynamicComponent() => builder =>
         builder.OpenComponent(0, typeof(SurveyPrompt));
         builder.AddAttribute(1, "Title", "Some title");

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.